pub struct WidgetInputState {
pub focus: FocusState,
pub hover: HoverState,
pub drag: DragState,
pub active: Option<WidgetId>,
pub last_click_time: f64,
pub last_click_pos: (f64, f64),
pub last_click_widget: Option<WidgetId>,
pub double_click_threshold_ms: f64,
pub double_click_distance: f64,
pub click_count: u8,
pub triple_click_threshold_ms: f64,
}Expand description
Combined widget input state
Fields§
§focus: FocusStateFocus management
hover: HoverStateHover tracking
drag: DragStateDrag tracking
active: Option<WidgetId>Active widget (pressed but not yet released)
last_click_time: f64Last click time for double-click detection
last_click_pos: (f64, f64)Last click position
last_click_widget: Option<WidgetId>Last clicked widget
double_click_threshold_ms: f64Double-click threshold in milliseconds
double_click_distance: f64Double-click distance threshold in pixels
click_count: u8Click count for multi-click detection (1 = single, 2 = double, 3 = triple)
triple_click_threshold_ms: f64Triple-click threshold in milliseconds
Implementations§
Source§impl WidgetInputState
impl WidgetInputState
pub fn new() -> Self
Sourcepub fn update_mouse(&mut self, x: f64, y: f64)
pub fn update_mouse(&mut self, x: f64, y: f64)
Update mouse position
Sourcepub fn mouse_press(&mut self, _x: f64, _y: f64, widget_id: Option<WidgetId>)
pub fn mouse_press(&mut self, _x: f64, _y: f64, widget_id: Option<WidgetId>)
Handle mouse press
Sourcepub fn mouse_release(&mut self, x: f64, y: f64, now: f64) -> WidgetInteraction
pub fn mouse_release(&mut self, x: f64, y: f64, now: f64) -> WidgetInteraction
Handle mouse release with click/double-click/triple-click detection
Sourcepub fn start_drag(&mut self, id: WidgetId, x: f64, y: f64)
pub fn start_drag(&mut self, id: WidgetId, x: f64, y: f64)
Start dragging a widget
Trait Implementations§
Source§impl Clone for WidgetInputState
impl Clone for WidgetInputState
Source§fn clone(&self) -> WidgetInputState
fn clone(&self) -> WidgetInputState
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 WidgetInputState
impl Debug for WidgetInputState
Source§impl Default for WidgetInputState
impl Default for WidgetInputState
Source§fn default() -> WidgetInputState
fn default() -> WidgetInputState
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for WidgetInputState
impl RefUnwindSafe for WidgetInputState
impl Send for WidgetInputState
impl Sync for WidgetInputState
impl Unpin for WidgetInputState
impl UnsafeUnpin for WidgetInputState
impl UnwindSafe for WidgetInputState
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