pub struct List<T> { /* private fields */ }Expand description
A list widget for displaying items
Implementations§
Source§impl<T> List<T>
impl<T> List<T>
Sourcepub fn highlight_fg(self, color: Color) -> Self
pub fn highlight_fg(self, color: Color) -> Self
Set highlight foreground color
Sourcepub fn highlight_bg(self, color: Color) -> Self
pub fn highlight_bg(self, color: Color) -> Self
Set highlight background color
Sourcepub fn selected_index(&self) -> usize
pub fn selected_index(&self) -> usize
Get selected index
Sourcepub fn select_next(&mut self)
pub fn select_next(&mut self)
Select next item (wraps around)
Sourcepub fn select_prev(&mut self)
pub fn select_prev(&mut self)
Select previous item (wraps around)
Sourcepub fn select_first(&mut self)
pub fn select_first(&mut self)
Select the first item
Sourcepub fn select_last(&mut self)
pub fn select_last(&mut self)
Select the last item
Sourcepub fn handle_key(&mut self, key: &Key) -> bool
pub fn handle_key(&mut self, key: &Key) -> bool
Handle key input for navigation
Trait Implementations§
Source§impl<T: Display> StyledView for List<T>
impl<T: Display> StyledView for List<T>
Source§fn remove_class(&mut self, class: &str)
fn remove_class(&mut self, class: &str)
Remove a CSS class
Source§fn toggle_class(&mut self, class: &str)
fn toggle_class(&mut self, class: &str)
Toggle a CSS class
Source§impl<T: Display> View for List<T>
impl<T: Display> View for List<T>
Source§fn meta(&self) -> WidgetMeta
fn meta(&self) -> WidgetMeta
Get widget metadata for DOM Read more
Source§fn render(&self, ctx: &mut RenderContext<'_>)
fn render(&self, ctx: &mut RenderContext<'_>)
Render the view to the given context Read more
Source§fn widget_type(&self) -> &'static str
fn widget_type(&self) -> &'static str
Get widget type name (for CSS type selectors) Read more
Auto Trait Implementations§
impl<T> !Freeze for List<T>
impl<T> !RefUnwindSafe for List<T>
impl<T> Send for List<T>where
T: Send,
impl<T> !Sync for List<T>
impl<T> Unpin for List<T>where
T: Unpin,
impl<T> UnsafeUnpin for List<T>
impl<T> UnwindSafe for List<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more