Expand description
§egui_dnd
… is a drag & drop library for egui.
Give it a try here: https://lucasmerlin.github.io/hello_egui/
To get started, take a look at the simple example.
Demo Videos:
https://github.com/lucasmerlin/hello_egui/assets/8009393/a05fa961-ef12-479c-a3fd-f765160e048e
https://github.com/lucasmerlin/hello_egui/assets/8009393/4e3b7843-822f-4900-8e8b-d516794590b7
Modules§
- Helper functions to support the drag and drop functionality
Structs§
- Helper struct for ease of use.
- Configuration for drag detection.
- 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.
- 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::ui is used to draw the drag handle
- State of the current item.
Traits§
- Item that can be reordered using drag and drop
Functions§
- 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: