Struct egui_dnd::DragDropConfig
source · 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
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 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more