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: Duration

How 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: f32

How 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: Duration

If 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

source

pub fn mouse() -> Self

Optimized for mouse usage

source

pub fn touch() -> Self

Optimized for touch usage in a fixed size area (no scrolling) Has a higher click tolerance than DragDropConfig::mouse

source

pub fn touch_scroll() -> Self

Optimized for touch usage in a scrollable area

Trait Implementations§

source§

impl Clone for DragDropConfig

source§

fn clone(&self) -> DragDropConfig

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for DragDropConfig

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for DragDropConfig

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> SerializableAny for T
where T: 'static + Any + Clone + for<'a> Send + Sync,