pub struct ListProps {
pub activatable: bool,
pub row_height: RowHeight,
pub selectable: bool,
pub multi_select: bool,
pub reorderable: bool,
pub deletable: bool,
pub delete_label: String,
pub swipe_actions: bool,
pub separators: Option<bool>,
pub editing: bool,
}Expand description
Native recycling list (docs/list.md). The host owns scrolling + cell reuse; Day supplies
row content on demand through the injected ListSource (see Toolkit::attach_list).
Fields§
§activatable: boolWhether the app handles row activation. Do not claim activation keys when false.
row_height: RowHeight§selectable: boolWhether the native list reports row selection (Event::SelectionChanged with the row).
multi_select: boolWhether the native list allows selecting several rows at once. Where honored
(docs/list.md has the matrix), every selection change reports the full set via
Event::SelectionSet; single-selection backends keep reporting
Event::SelectionChanged and treat this as selectable.
reorderable: boolWhether rows can be drag-reordered. The toolkit enables its native drag machinery and
drives ListSource::reorder (validate via can_move, commit via move_row);
probe Cap::ListReorder for per-backend support (docs/list.md).
deletable: boolWhether rows can be deleted by the platform’s own delete gesture: a trailing swipe on
iOS and ArkUI, an ItemTouchHelper swipe on Android. The toolkit drives
ListSource::delete (offer via can_delete, commit via delete_row); probe
Cap::ListDelete for per-backend support (docs/list.md). Desktop toolkits have no such
gesture and answer Unsupported; an app that must delete everywhere pairs this with an
explicit control (a menu item, a button) rather than relying on the swipe.
delete_label: StringThe label on that affordance, already localized by the app. A toolkit cannot invent translated text (it has no access to the app’s catalog), so the string arrives with the props. Empty means “no text”: each backend falls back to its platform’s own wordless idiom (a trash glyph), which works in every language.
swipe_actions: boolThe rows offer edge swipe actions (docs/list.md) through the injected
ListSource::swipe (offer via actions_at, commit via perform); probe
crate::Cap::ListSwipeActions for per-backend support. A backend without the
affordance never shows one; an app that must offer the command everywhere
pairs the swipe with an explicit control, exactly as deletable documents.
separators: Option<bool>Row separators, drawn by the host at the row boundary (docs/list.md), so they
align with the native selection and ride the platform’s own row animations (a
macOS/iOS swipe slides the row content past a stationary separator, exactly as
Mail’s does). None keeps each platform’s own default (iOS draws them, the
desktops don’t); Some(true)/Some(false) forces. A backend without a separator
mechanism ignores a force (the matrix in docs/list.md says which); rows there
separate by their pitch alone.
editing: boolThe list starts in the platform’s editing mode (docs/list.md): delete controls on
the rows deletable offers, reorder grips on the rows reorderable moves, and a
tap that still activates. Later changes arrive as ListPatch::Editing. Probe
crate::Cap::ListEditing; a backend without an editing mode ignores it.