pub struct List<'a> { /* private fields */ }Expand description
A scrollable list with item selection highlighting.
Implementations§
Source§impl<'a> List<'a>
impl<'a> List<'a>
Sourcepub fn scroll_offset(self, offset: u16) -> Self
pub fn scroll_offset(self, offset: u16) -> Self
Sets the scroll offset from the top.
Sourcepub fn palette(self, palette: AislingPalette) -> Self
pub fn palette(self, palette: AislingPalette) -> Self
Sets the color palette.
Sourcepub fn render_with_interaction(
&self,
frame: &mut Frame<'_>,
id: impl Into<WidgetId>,
area: Rect,
)
pub fn render_with_interaction( &self, frame: &mut Frame<'_>, id: impl Into<WidgetId>, area: Rect, )
Renders into a Scrin frame and registers hit regions for visible items.
Sourcepub fn hit_regions(&self, id: impl Into<WidgetId>, area: Rect) -> Vec<HitRegion>
pub fn hit_regions(&self, id: impl Into<WidgetId>, area: Rect) -> Vec<HitRegion>
Builds Scrin interaction metadata for the visible list items.
Sourcepub fn selectable_spans(
&self,
id: impl Into<WidgetId>,
area: Rect,
) -> Vec<SelectableSpan>
pub fn selectable_spans( &self, id: impl Into<WidgetId>, area: Rect, ) -> Vec<SelectableSpan>
Builds selectable spans for the visible list item labels.
Sourcepub fn scroll_region(
&self,
id: impl Into<WidgetId>,
area: Rect,
) -> Option<(Rect, usize, Vec<ScrollRowHit>)>
pub fn scroll_region( &self, id: impl Into<WidgetId>, area: Rect, ) -> Option<(Rect, usize, Vec<ScrollRowHit>)>
Builds Scrin scroll-region metadata for visible list rows.
Sourcepub fn item_count(&self) -> usize
pub fn item_count(&self) -> usize
Returns the number of items.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for List<'a>
impl<'a> RefUnwindSafe for List<'a>
impl<'a> Send for List<'a>
impl<'a> Sync for List<'a>
impl<'a> Unpin for List<'a>
impl<'a> UnsafeUnpin for List<'a>
impl<'a> UnwindSafe for List<'a>
Blanket Implementations§
Source§impl<W> AislingExt for Wwhere
W: Widget,
impl<W> AislingExt for Wwhere
W: Widget,
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