Structs§
- DragEnd
- Sent to the drag source when the drag ends (drop or cancel).
- Drag
Over - Drag
Preview Ctx - Context passed to a drag preview painter each frame while dragging.
- Drag
Session - Tracks an active drag session (internal widget-to-widget DnD).
- Drag
Start - Drop
Event - Dropped
File - A single dropped file descriptor.
- Dropped
Files - Payload type for file drag/drop coming from the OS/browser.
Traits§
- Drag
Drop Modifier Ext - Compose-like typed drag/drop modifier helpers.
Functions§
- current_
drag_ session - Current drag session snapshot (if any).
- dnd_
target_ id_ at - downcast_
drag_ payload - Try to downcast a drag payload to a typed reference. Used on the drop side.
- drag_
and_ drop_ source - Block-style convenience for [
Modifier::on_drag_start] with a typed payload. - drag_
and_ drop_ source_ with_ preview - Typed source + custom drag decoration in one call.
- drag_
and_ drop_ target - Block-style convenience for [
Modifier::on_drop] with a typed payload. The drop is accepted when the closure returnstrue; the typed payload is downcast before the closure is invoked. - drag_
payload - Wrap a typed value into a
DragPayloadfor a drag source. - drag_
preview_ chip - Label chip with a slightly larger “elevated” look (shadow-ish fill).
- drag_
preview_ label - Simple floating label chip (good default for tabs / list rows).
- handle_
drag_ action - Handle a DragAction from the platform. Returns true if the action was consumed.
- is_
dragging - Check if a drag session is currently active.
- overlay_
drag_ indicator - Draw drag overlay indicator on the scene.
external_file_dragenables orange styling for OS/browser file-drop overlays. - provide_
drag_ preview - Call from
on_drag_startto supply a session-specific preview. - set_
dnd_ frame - Set the current frame for DnD hit-testing. Called by platform after each render.
- set_
dnd_ scale - Set the display scale for DnD slop calculation.
Type Aliases§
- Drag
Payload - Opaque payload moved during internal drag & drop.
Use
downcast_drag_payloadon the receiver side to recover a typed value. - Drag
Preview - Painter for the floating drag decoration.
Coordinates are in screen px. Draw relative to
ctx.pointer/ctx.grab_offset.