pub trait ListModifiers: Sized {
Show 18 methods
// Required methods
fn selection<R>(self, selection: impl Res<R> + 'static) -> Self
where R: Deref<Target = [usize]> + Clone + 'static;
fn focused_index(self, focused: impl Res<Option<usize>> + 'static) -> Self;
fn on_select<F>(self, callback: F) -> Self
where F: 'static + Fn(&mut EventContext<'_>, usize);
fn on_focus<F>(self, callback: F) -> Self
where F: 'static + Fn(&mut EventContext<'_>, usize);
fn selectable<U: Into<Selectable> + Clone + 'static>(
self,
selectable: impl Res<U> + 'static,
) -> Self;
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: Into<bool> + Clone + 'static>(
self,
flag: impl Res<U> + 'static,
) -> Self;
fn space_selects_focused<U: Into<bool> + Clone + 'static>(
self,
flag: impl Res<U> + 'static,
) -> Self;
fn horizontal<U: Into<bool> + Clone + 'static>(
self,
horizontal: impl Res<U> + 'static,
) -> Self;
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) + 'static + Send + Sync,
) -> 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§
Sourcefn selection<R>(self, selection: impl Res<R> + 'static) -> Self
fn selection<R>(self, selection: impl Res<R> + 'static) -> Self
Sets the selected items of the list from signal of type indices.
Sourcefn focused_index(self, focused: impl Res<Option<usize>> + 'static) -> Self
fn focused_index(self, focused: impl Res<Option<usize>> + 'static) -> Self
Sets the focused item of the list from a signal of an optional index.
Sourcefn on_select<F>(self, callback: F) -> Self
fn on_select<F>(self, callback: F) -> Self
Sets the callback triggered when a ListItem is selected.
Sourcefn on_focus<F>(self, callback: F) -> Self
fn on_focus<F>(self, callback: F) -> Self
Sets the callback triggered when a ListItem receives focus.
Sourcefn selectable<U: Into<Selectable> + Clone + 'static>(
self,
selectable: impl Res<U> + 'static,
) -> Self
fn selectable<U: Into<Selectable> + Clone + 'static>( self, selectable: impl Res<U> + 'static, ) -> Self
Set the selectable state of the List.
Sourcefn min_selected(self, min_selected: impl Res<usize> + 'static) -> Self
fn min_selected(self, min_selected: impl Res<usize> + 'static) -> Self
Sets the minimum number of selected items.
Sourcefn max_selected(self, max_selected: impl Res<usize> + 'static) -> Self
fn max_selected(self, max_selected: impl Res<usize> + 'static) -> Self
Sets the maximum number of selected items.
Sourcefn selection_follows_focus<U: Into<bool> + Clone + 'static>(
self,
flag: impl Res<U> + 'static,
) -> Self
fn selection_follows_focus<U: Into<bool> + Clone + 'static>( self, flag: impl Res<U> + 'static, ) -> Self
Sets whether the selection should follow the focus.
Sourcefn space_selects_focused<U: Into<bool> + Clone + 'static>(
self,
flag: impl Res<U> + 'static,
) -> Self
fn space_selects_focused<U: Into<bool> + Clone + 'static>( self, flag: impl Res<U> + 'static, ) -> Self
Sets whether pressing Space should select the currently focused item.
Sourcefn horizontal<U: Into<bool> + Clone + 'static>(
self,
horizontal: impl Res<U> + 'static,
) -> Self
fn horizontal<U: Into<bool> + Clone + 'static>( self, horizontal: impl Res<U> + 'static, ) -> Self
Sets the orientation of the list.
Sourcefn scroll_to_cursor(self, flag: bool) -> Self
fn scroll_to_cursor(self, flag: bool) -> Self
Sets whether the scrollbar should move to the cursor when pressed.
Sourcefn focus_first_item_on_focus_in(self, flag: impl Res<bool> + 'static) -> Self
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.
Sourcefn on_scroll(
self,
callback: impl Fn(&mut EventContext<'_>, f32, f32) + 'static + Send + Sync,
) -> Self
fn on_scroll( self, callback: impl Fn(&mut EventContext<'_>, f32, f32) + 'static + Send + Sync, ) -> Self
Sets a callback which will be called when a scrollview is scrolled, either with the mouse wheel, touchpad, or using the scroll bars.
Sourcefn scroll_x(self, scrollx: impl Res<f32> + 'static) -> Self
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.
Sourcefn scroll_y(self, scrolly: impl Res<f32> + 'static) -> Self
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.
Sourcefn show_horizontal_scrollbar(self, flag: impl Res<bool> + 'static) -> Self
fn show_horizontal_scrollbar(self, flag: impl Res<bool> + 'static) -> Self
Sets whether the horizontal scrollbar should be visible.
Sourcefn show_vertical_scrollbar(self, flag: impl Res<bool> + 'static) -> Self
fn show_vertical_scrollbar(self, flag: impl Res<bool> + 'static) -> Self
Sets whether the vertical scrollbar should be visible.
Sourcefn type_ahead_text<F>(self, callback: F) -> Self
fn type_ahead_text<F>(self, callback: F) -> Self
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".