Skip to main content

ListProps

Struct ListProps 

Source
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: bool

Whether the app handles row activation. Do not claim activation keys when false.

§row_height: RowHeight§selectable: bool

Whether the native list reports row selection (Event::SelectionChanged with the row).

§multi_select: bool

Whether 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: bool

Whether 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: bool

Whether 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: String

The 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: bool

The 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: bool

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

Trait Implementations§

Source§

impl Clone for ListProps

Source§

fn clone(&self) -> ListProps

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ListProps

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ListProps

Source§

fn default() -> ListProps

Returns the “default value” for a type. Read more
Source§

impl PartialEq for ListProps

Source§

fn eq(&self, other: &ListProps) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ListProps

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Day API ↩ Guides· daybrite.dev