pub struct Sense {
pub click: bool,
pub drag: bool,
pub hover: bool,
pub focus: bool,
}Expand description
What interactions a widget is sensitive to
Using CLICK_AND_DRAG introduces latency to distinguish click vs drag intent.
Fields§
§click: boolWidget responds to clicks
drag: boolWidget responds to drags
hover: boolWidget tracks hover state
focus: boolWidget can receive keyboard focus
Implementations§
Source§impl Sense
impl Sense
Sourcepub fn click_and_drag() -> Self
pub fn click_and_drag() -> Self
Create click and drag sense (includes hover, introduces latency)
Source§impl Sense
impl Sense
Sourcepub fn intersection(self, other: Sense) -> Sense
pub fn intersection(self, other: Sense) -> Sense
Intersection of two senses (AND)
Sourcepub fn with_click(self) -> Self
pub fn with_click(self) -> Self
Add click sensing (also adds hover)
Sourcepub fn with_focus(self) -> Self
pub fn with_focus(self) -> Self
Add focus capability
Source§impl Sense
impl Sense
Sourcepub fn interactive(&self) -> bool
pub fn interactive(&self) -> bool
Check if any interaction is sensed (click, drag, or focus)
Sourcepub fn has_click_and_drag(&self) -> bool
pub fn has_click_and_drag(&self) -> bool
Check if both click and drag are sensed (has latency)
Sourcepub fn is_passive(&self) -> bool
pub fn is_passive(&self) -> bool
Check if widget is purely visual (no interactions)
Trait Implementations§
Source§impl BitOrAssign for Sense
impl BitOrAssign for Sense
Source§fn bitor_assign(&mut self, rhs: Self)
fn bitor_assign(&mut self, rhs: Self)
Combine this sense with another using |=
impl Copy for Sense
impl Eq for Sense
impl StructuralPartialEq for Sense
Auto Trait Implementations§
impl Freeze for Sense
impl RefUnwindSafe for Sense
impl Send for Sense
impl Sync for Sense
impl Unpin for Sense
impl UnsafeUnpin for Sense
impl UnwindSafe for Sense
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