pub trait ListRows<K: Key> {
// Required methods
fn len(&self) -> usize;
fn key(&self, row: usize) -> K;
fn label(&self, row: usize) -> String;
// Provided methods
fn is_empty(&self) -> bool { ... }
fn item(&self, row: usize) -> SelectionItem { ... }
fn icon(&self, row: usize) -> Option<Source> { ... }
fn trailing(&self, row: usize) -> Option<String> { ... }
fn ui(&mut self, ui: &mut Ui, row: usize, selected: bool) { ... }
}Expand description
The rows a list shows; the application owns them.
Required Methods§
Provided Methods§
fn is_empty(&self) -> bool
Sourcefn item(&self, row: usize) -> SelectionItem
fn item(&self, row: usize) -> SelectionItem
Row row’s item in the application-wide selection
(ListView::shared): by default its key’s
(SelectionItem::from_key). Give the id other widgets showing
the same thing use.
Sourcefn icon(&self, row: usize) -> Option<Source>
fn icon(&self, row: usize) -> Option<Source>
Row row’s icon, drawn before what ListRows::ui draws, in
the row’s text colour (default: none).
Sourcefn trailing(&self, row: usize) -> Option<String>
fn trailing(&self, row: usize) -> Option<String>
Row row’s weak text on its right (a count, a type; default:
none), in the row’s muted tone; what ListRows::ui draws stops
before it.
Sourcefn ui(&mut self, ui: &mut Ui, row: usize, selected: bool)
fn ui(&mut self, ui: &mut Ui, row: usize, selected: bool)
Draws row row (its background is drawn, with its icon and its
trailing text, a list item’s; the row is named by
its label). By default, its label on one line, elided with “…”
when it does not fit, the row then showing the full label on hover.