pub struct SelectionState {
pub selected: HashSet<u64>,
pub anchor: Option<u64>,
pub cursor: Option<u64>,
pub dragging: bool,
}Expand description
Logical grid selection state.
Fields§
§selected: HashSet<u64>Set of selected absolute row indices.
anchor: Option<u64>Anchor for Shift+click range selection.
cursor: Option<u64>Keyboard cursor position (active row).
dragging: boolWhether the user is currently drag-selecting.
Implementations§
Source§impl SelectionState
impl SelectionState
Sourcepub fn select_all(&mut self, total_rows: u64)
pub fn select_all(&mut self, total_rows: u64)
Select all rows 0..total_rows.
Sourcepub fn is_selected(&self, row: u64) -> bool
pub fn is_selected(&self, row: u64) -> bool
Check if a row is selected.
Sourcepub fn on_pointer_down(
&mut self,
row: u64,
ctrl: bool,
shift: bool,
total_rows: u64,
)
pub fn on_pointer_down( &mut self, row: u64, ctrl: bool, shift: bool, total_rows: u64, )
Handle pointer down on a row.
Sourcepub fn on_pointer_enter_drag(&mut self, row: u64, total_rows: u64)
pub fn on_pointer_enter_drag(&mut self, row: u64, total_rows: u64)
Handle pointer enter during drag.
Sourcepub fn on_pointer_up(&mut self)
pub fn on_pointer_up(&mut self)
Handle pointer up — stop dragging.
Handle right-click: if the row is not selected, select only it. If already selected, keep selection.
Trait Implementations§
Source§impl Clone for SelectionState
impl Clone for SelectionState
Source§fn clone(&self) -> SelectionState
fn clone(&self) -> SelectionState
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SelectionState
impl Debug for SelectionState
Source§impl Default for SelectionState
impl Default for SelectionState
Source§fn default() -> SelectionState
fn default() -> SelectionState
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SelectionState
impl RefUnwindSafe for SelectionState
impl Send for SelectionState
impl Sync for SelectionState
impl Unpin for SelectionState
impl UnsafeUnpin for SelectionState
impl UnwindSafe for SelectionState
Blanket Implementations§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> SerializableKey for T
impl<T> SerializableKey for T
Source§impl<T> StorageAccess<T> for T
impl<T> StorageAccess<T> for T
Source§fn as_borrowed(&self) -> &T
fn as_borrowed(&self) -> &T
Borrows the value.
Source§fn into_taken(self) -> T
fn into_taken(self) -> T
Takes the value.