pub struct DragController { /* private fields */ }Expand description
Reports drags: a press followed by movement past a threshold.
Reports ControllerEvent::DragStarted followed by ControllerEvent::DragUpdated when the
pointer first moves threshold pixels from the press, then an update per move, then
ControllerEvent::DragEnded on release. A press and release without crossing the threshold
reports nothing, so it can still be a click.
Implementations§
Source§impl DragController
impl DragController
Sourcepub const DEFAULT_THRESHOLD: u32 = 4
pub const DEFAULT_THRESHOLD: u32 = 4
The default distance, in pixels, the pointer must move before a drag starts.
Sourcepub fn with_threshold(threshold: u32) -> Self
pub fn with_threshold(threshold: u32) -> Self
Sourcepub fn is_dragging(&self) -> bool
pub fn is_dragging(&self) -> bool
Trait Implementations§
Source§impl Controller for DragController
impl Controller for DragController
Source§fn handle(
&mut self,
widget: WidgetId,
event: &Event,
out: &mut Vec<ControllerEvent>,
)
fn handle( &mut self, widget: WidgetId, event: &Event, out: &mut Vec<ControllerEvent>, )
Examines one event and reports any result.
§Arguments
widget- The ID of the owningWidget.event- The event theWidgetreceived.out- Where results are pushed.
Source§fn event_mask(&self) -> EventMask
fn event_mask(&self) -> EventMask
Returns the event classes this controller needs.
§Returns
The mask added to the Widget’s event mask.
Auto Trait Implementations§
impl Freeze for DragController
impl RefUnwindSafe for DragController
impl Send for DragController
impl Sync for DragController
impl Unpin for DragController
impl UnsafeUnpin for DragController
impl UnwindSafe for DragController
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