egui/crates
Emil Ernerfeldt abd028bad3
Add drag-and-drop APIs with payloads storage (#3887)
* Closes https://github.com/emilk/egui/issues/3882

This adds several methods to make drag-and-drop more ergonomic in egui.

In particular, egui can now keep track of _what_ is being dragged for
you (the _payload_).

Low-level:
* `egui::DragAndDrop` hold the payload during a drag

Mid-level:
* `Response::dnd_set_drag_payload` sets it for drag-sources
* `Response::dnd_hover_payload` and `Response::dnd_release_payload`
reads it for drop-targets

High-level:
* `ui.dnd_drag_source`: make a widget draggable
* `ui.dnd_drop_zone`: a container where things can be dropped

The drag-and-drop demo is now a lot simpler:


https://github.com/emilk/egui/blob/emilk/drag-and-drop/crates/egui_demo_lib/src/demo/drag_and_drop.rs

---------

Co-authored-by: Antoine Beyeler <abeyeler@ab-ware.com>
2024-01-29 11:14:18 +01:00
..
ecolor Use `Self` everywhere (#3787) 2024-01-08 17:41:21 +01:00
eframe Re-try adapter creation if creation with WebGPU enabled fails and WebGL was enabled. (#3895) 2024-01-29 11:04:05 +01:00
egui Add drag-and-drop APIs with payloads storage (#3887) 2024-01-29 11:14:18 +01:00
egui-wgpu `egui-wgpu`: turn off the default features of `wgpu` (#3875) 2024-01-24 09:43:40 +01:00
egui-winit `egui_winit`: Allow getting the `clipboard` and `allow_ime` state (#3724) 2024-01-23 12:49:28 +01:00
egui_demo_app Update wgpu to 0.19 (#3824) 2024-01-19 10:14:13 +01:00
egui_demo_lib Add drag-and-drop APIs with payloads storage (#3887) 2024-01-29 11:14:18 +01:00
egui_extras Use a selectable label for syntax-highlighted text in egui_extras 2024-01-22 14:47:58 +01:00
egui_glow Update wgpu to 0.19 (#3824) 2024-01-19 10:14:13 +01:00
egui_plot egui_plot: customizable spacing of grid and axis label spacing (#3896) 2024-01-26 13:36:49 +01:00
egui_web Fix typos (#2866) 2023-04-18 15:52:45 +02:00
emath Cross-widget text select (#3870) 2024-01-24 15:45:22 +01:00
epaint Fix text selection crashes 2024-01-24 15:47:44 +01:00