pub trait ListModifiers: Sized {
Show 13 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: 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 horizontal<U: Into<bool> + Clone + 'static>(
self,
horizontal: impl Res<U> + 'static,
) -> Self;
fn scroll_to_cursor(self, flag: bool) -> 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, scrollx: 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;
}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 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 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 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 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, scrollx: impl Res<f32> + 'static) -> Self
fn scroll_y(self, scrollx: 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.
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.