Crate egui_dnd

Source
Expand description

Modules§

utils
Helper functions to support the drag and drop functionality

Structs§

Dnd
Helper struct for ease of use.
DragDropConfig
Configuration for drag detection.
DragDropResponse
Response containing state of the drag & drop list and a potential update to the source list. The update can be applied immediately or at latest when DragDropResponse::is_drag_finished returns true.
DragUpdate
An instruction in what order to update the source list. The item at from should be removed from the list and inserted at to. You can use shift_vec to do this for a Vec.
Handle
Handle::ui is used to draw the drag handle
ItemIterator
Calculates some information that is later used to detect in which index the dragged item should be placed. ItemIterator::next should be called for each item in the list.
ItemState
State of the current item.

Traits§

DragDropItem
Item that can be reordered using drag and drop

Functions§

dnd
Main entry point for the drag and drop functionality. Loads and saves it’s state from egui memory. Use either Dnd::show or Dnd::show_vec to display the drag and drop UI. You can use Dnd::with_mouse_config or Dnd::with_touch_config to configure the drag detection. Example usage: