pub struct CheckedModel { /* private fields */ }Expand description
Per-row checkbox state for a flat list, with a reactive aggregate checked-set.
Implementations§
Source§impl CheckedModel
impl CheckedModel
Sourcepub fn checked_signal(&self) -> Signal<BTreeSet<usize>>
pub fn checked_signal(&self) -> Signal<BTreeSet<usize>>
Reactive view of the full checked-set.
Sourcepub fn signal_for(&self, index: usize) -> Signal<bool>
pub fn signal_for(&self, index: usize) -> Signal<bool>
Writable per-index signal. Repeat calls cache the same handle —
any consumer (the model itself, the Checkbox widget, an external
observer) writing through it propagates to the central
checked_signal().
Sourcepub fn adjust_for_insert(&self, start: usize, count: usize)
pub fn adjust_for_insert(&self, start: usize, count: usize)
Shift checked-state after count rows are inserted at start.
Indices >= start move up by count.
Sourcepub fn adjust_for_remove(&self, start: usize, count: usize)
pub fn adjust_for_remove(&self, start: usize, count: usize)
Shift checked-state after count rows starting at start are removed.
Checked rows in start..start+count are dropped; later rows shift down.
Sourcepub fn adjust_for_move(&self, from: usize, to: usize, count: usize)
pub fn adjust_for_move(&self, from: usize, to: usize, count: usize)
Shift checked-state after a block of count rows moved from from to
to (a post-removal index, matching ListModel::move_item). Checked
rows follow their items.
Sourcepub fn is_checked(&self, index: usize) -> bool
pub fn is_checked(&self, index: usize) -> bool
Returns true if the row at index is currently checked.
Sourcepub fn checked_indices(&self) -> Vec<usize>
pub fn checked_indices(&self) -> Vec<usize>
Returns a sorted Vec of every currently checked row index.
Sourcepub fn checked_count(&self) -> usize
pub fn checked_count(&self) -> usize
Returns the number of currently checked rows.
Sourcepub fn check(&self, index: usize)
pub fn check(&self, index: usize)
Marks the row at index as checked; notifies observers if the state changed.
Sourcepub fn uncheck(&self, index: usize)
pub fn uncheck(&self, index: usize)
Marks the row at index as unchecked; notifies observers if the state changed.
Sourcepub fn toggle(&self, index: usize)
pub fn toggle(&self, index: usize)
Flips the checked state of the row at index; notifies observers.