Skip to main content

Module dnd

Module dnd 

Source

Structs§

DragEnd
Sent to the drag source when the drag ends (drop or cancel).
DragOver
DragPreviewCtx
Context passed to a drag preview painter each frame while dragging.
DragSession
Tracks an active drag session (internal widget-to-widget DnD).
DragStart
DropEvent
DroppedFile
A single dropped file descriptor.
DroppedFiles
Payload type for file drag/drop coming from the OS/browser.

Traits§

DragDropModifierExt
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 returns true; the typed payload is downcast before the closure is invoked.
drag_payload
Wrap a typed value into a DragPayload for 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_drag enables orange styling for OS/browser file-drop overlays.
provide_drag_preview
Call from on_drag_start to 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§

DragPayload
Opaque payload moved during internal drag & drop. Use downcast_drag_payload on the receiver side to recover a typed value.
DragPreview
Painter for the floating drag decoration. Coordinates are in screen px. Draw relative to ctx.pointer / ctx.grab_offset.