pub struct DragDropManager { /* private fields */ }Expand description
Drag and drop manager.
Implementations§
Source§impl DragDropManager
impl DragDropManager
Sourcepub fn set_min_drag_distance(&mut self, distance: f32)
pub fn set_min_drag_distance(&mut self, distance: f32)
Set minimum drag distance.
Sourcepub fn set_preview_offset(&mut self, offset: Point)
pub fn set_preview_offset(&mut self, offset: Point)
Set drag preview offset.
Sourcepub fn register_target(&mut self, target: DropTarget)
pub fn register_target(&mut self, target: DropTarget)
Register a drop target.
Sourcepub fn unregister_target(&mut self, widget_id: WidgetId)
pub fn unregister_target(&mut self, widget_id: WidgetId)
Unregister a drop target.
Sourcepub fn update_target_bounds(&mut self, widget_id: WidgetId, bounds: Rect)
pub fn update_target_bounds(&mut self, widget_id: WidgetId, bounds: Rect)
Update a target’s bounds.
Sourcepub fn start_drag(
&mut self,
source_widget: WidgetId,
position: Point,
data: DragData,
) -> DragId
pub fn start_drag( &mut self, source_widget: WidgetId, position: Point, data: DragData, ) -> DragId
Start a drag operation.
Sourcepub fn drop(&mut self) -> Option<DropResult>
pub fn drop(&mut self) -> Option<DropResult>
End drag with drop attempt.
Sourcepub fn is_dragging(&self) -> bool
pub fn is_dragging(&self) -> bool
Check if a drag is active.
Sourcepub fn preview_position(&self) -> Option<Point>
pub fn preview_position(&self) -> Option<Point>
Get the preview position for rendering.
Sourcepub fn target_count(&self) -> usize
pub fn target_count(&self) -> usize
Get drop targets count.
Sourcepub fn target_at(&self, position: Point) -> Option<&DropTarget>
pub fn target_at(&self, position: Point) -> Option<&DropTarget>
Find target at position.