Skip to main content

ListModifiers

Trait ListModifiers 

pub trait ListModifiers: Sized {
Show 15 methods // Required methods fn selection<R>(self, selection: impl Res<R> + 'static) -> Self where R: Deref<Target = [usize]> + Clone + 'static; fn on_select<F>(self, callback: F) -> Self where F: 'static + Fn(&mut EventContext<'_>, usize); fn selectable<U>(self, selectable: impl Res<U> + 'static) -> Self where U: Into<Selectable> + Clone + 'static; fn min_selected(self, min_selected: impl Res<usize> + 'static) -> Self; fn max_selected(self, max_selected: impl Res<usize> + 'static) -> Self; fn selection_follows_focus<U>(self, flag: impl Res<U> + 'static) -> Self where U: Into<bool> + Clone + 'static; fn horizontal<U>(self, horizontal: impl Res<U> + 'static) -> Self where U: Into<bool> + Clone + 'static; fn scroll_to_cursor(self, flag: bool) -> Self; fn focus_first_item_on_focus_in( self, flag: impl Res<bool> + 'static, ) -> Self; fn on_scroll( self, callback: impl Fn(&mut EventContext<'_>, f32, f32) + Send + Sync + 'static, ) -> Self; fn scroll_x(self, scrollx: impl Res<f32> + 'static) -> Self; fn scroll_y(self, scrolly: impl Res<f32> + 'static) -> Self; fn show_horizontal_scrollbar(self, flag: impl Res<bool> + 'static) -> Self; fn show_vertical_scrollbar(self, flag: impl Res<bool> + 'static) -> Self; fn type_ahead_text<F>(self, callback: F) -> Self where F: 'static + Fn(&mut EventContext<'_>, usize) -> Option<String>;
}
Expand description

Modifiers for changing the behavior and selection state of a List.

Required Methods§

fn selection<R>(self, selection: impl Res<R> + 'static) -> Self
where R: Deref<Target = [usize]> + Clone + 'static,

Sets the selected items of the list from signal of type indices.

fn on_select<F>(self, callback: F) -> Self
where F: 'static + Fn(&mut EventContext<'_>, usize),

Sets the callback triggered when a ListItem is selected.

fn selectable<U>(self, selectable: impl Res<U> + 'static) -> Self
where U: Into<Selectable> + Clone + 'static,

Set the selectable state of the List.

fn min_selected(self, min_selected: impl Res<usize> + 'static) -> Self

Sets the minimum number of selected items.

fn max_selected(self, max_selected: impl Res<usize> + 'static) -> Self

Sets the maximum number of selected items.

fn selection_follows_focus<U>(self, flag: impl Res<U> + 'static) -> Self
where U: Into<bool> + Clone + 'static,

Sets whether the selection should follow the focus.

fn horizontal<U>(self, horizontal: impl Res<U> + 'static) -> Self
where U: Into<bool> + Clone + 'static,

Sets the orientation of the list.

fn scroll_to_cursor(self, flag: bool) -> Self

Sets whether the scrollbar should move to the cursor when pressed.

fn focus_first_item_on_focus_in(self, flag: impl Res<bool> + 'static) -> Self

Sets whether the first item should be focused when the list gains focus with no selection.

fn on_scroll( self, callback: impl Fn(&mut EventContext<'_>, f32, f32) + Send + Sync + 'static, ) -> Self

Sets a callback which will be called when a scrollview is scrolled, either with the mouse wheel, touchpad, or using the scroll bars.

fn scroll_x(self, scrollx: impl Res<f32> + 'static) -> Self

Set the horizontal scroll position of the ScrollView. Accepts a value or signal of type an f32 between 0 and 1.

fn scroll_y(self, scrolly: impl Res<f32> + 'static) -> Self

Set the vertical scroll position of the ScrollView. Accepts a value or signal of type an f32 between 0 and 1.

fn show_horizontal_scrollbar(self, flag: impl Res<bool> + 'static) -> Self

Sets whether the horizontal scrollbar should be visible.

fn show_vertical_scrollbar(self, flag: impl Res<bool> + 'static) -> Self

Sets whether the vertical scrollbar should be visible.

fn type_ahead_text<F>(self, callback: F) -> Self
where F: 'static + Fn(&mut EventContext<'_>, usize) -> Option<String>,

Enables type-ahead navigation by providing searchable text per item index.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§