Skip to main content

ListModifiers

Trait ListModifiers 

Source
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§

Source

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.

Source

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.

Source

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

Sets the callback triggered when a ListItem is selected.

Source

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

Sets the callback triggered when a ListItem receives focus.

Source

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

Set the selectable state of the List.

Source

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

Sets the minimum number of selected items.

Source

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

Sets the maximum number of selected items.

Source

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

Sets whether the selection should follow the focus.

Source

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.

Source

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

Sets the orientation of the list.

Source

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

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

Source

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.

Source

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.

Source

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.

Source

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.

Source

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

Sets whether the horizontal scrollbar should be visible.

Source

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

Sets whether the vertical scrollbar should be visible.

Source

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".

Implementors§