pub struct DragDropManager { /* private fields */ }Expand description
Drag and drop manager.
Implementations§
Source§impl DragDropManager
impl DragDropManager
Sourcepub fn new() -> DragDropManager
pub fn new() -> DragDropManager
Create a new drag/drop manager.
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.
Trait Implementations§
Source§impl Debug for DragDropManager
impl Debug for DragDropManager
Source§impl Default for DragDropManager
impl Default for DragDropManager
Source§fn default() -> DragDropManager
fn default() -> DragDropManager
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for DragDropManager
impl !RefUnwindSafe for DragDropManager
impl Send for DragDropManager
impl Sync for DragDropManager
impl Unpin for DragDropManager
impl !UnwindSafe for DragDropManager
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
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>
Converts
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>
Converts
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().