pub struct DragDropConfig {
pub drag_delay: Duration,
pub scroll_tolerance: Option<f32>,
pub click_tolerance: f32,
pub click_tolerance_timeout: Duration,
}Expand description
Configuration for drag detection.
Fields§
§drag_delay: DurationHow long does the user have to keep pressing until a drag may begin? This is useful when dragging and dropping on a touch screen in a scrollable area.
scroll_tolerance: Option<f32>How far can the pointer move during the DragDropConfig::drag_delay before the drag is cancelled?
click_tolerance: f32How far does the pointer have to move before a drag starts?
This is useful when the handle is also a button.
If the pointer is released before this threshold, the drag never starts and the button / handle can be clicked.
If you want to detect clicks on the handle itself, Handle::sense to add a click sense to the handle.
click_tolerance_timeout: DurationIf we have been holding longer than this duration, a drag will be started even if the pointer has not moved above DragDropConfig::click_tolerance.
Implementations§
Source§impl DragDropConfig
impl DragDropConfig
Sourcepub fn touch() -> Self
pub fn touch() -> Self
Optimized for touch usage in a fixed size area (no scrolling)
Has a higher click tolerance than DragDropConfig::mouse
Sourcepub fn touch_scroll() -> Self
pub fn touch_scroll() -> Self
Optimized for touch usage in a scrollable area
Trait Implementations§
Source§impl Clone for DragDropConfig
impl Clone for DragDropConfig
Source§fn clone(&self) -> DragDropConfig
fn clone(&self) -> DragDropConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DragDropConfig
impl Debug for DragDropConfig
Auto Trait Implementations§
impl Freeze for DragDropConfig
impl RefUnwindSafe for DragDropConfig
impl Send for DragDropConfig
impl Sync for DragDropConfig
impl Unpin for DragDropConfig
impl UnsafeUnpin for DragDropConfig
impl UnwindSafe for DragDropConfig
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> ⓘ
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> ⓘ
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 more