Skip to content

Add an example of handling drag-and-drop reordering in a hierarchical list#3903

Draft
abey79 wants to merge 5 commits intomainfrom
antoine/hierachical_dnd_example
Draft

Add an example of handling drag-and-drop reordering in a hierarchical list#3903
abey79 wants to merge 5 commits intomainfrom
antoine/hierachical_dnd_example

Conversation

@abey79
Copy link
Copy Markdown
Collaborator

@abey79 abey79 commented Jan 27, 2024

This PR adds a demo of using the low-level API introduced in #3887 to implement drag-and-drop reordering in a hierarchical list.

drag_and_drop_5.mp4

@abey79 abey79 changed the base branch from master to emilk/drag-and-drop January 27, 2024 11:39
@abey79 abey79 added the docs and examples Improving and adding documentation and examples label Jan 27, 2024
@abey79 abey79 marked this pull request as draft January 27, 2024 11:40
@crumblingstatue
Copy link
Copy Markdown
Contributor

Thank you, this will be very useful to help me get drag and drop working in some places in my egui apps, once #3887 is merged.

Base automatically changed from emilk/drag-and-drop to master January 29, 2024 10:14
@emilk
Copy link
Copy Markdown
Owner

emilk commented Jan 29, 2024

#3887 is merged, so this can be rebased

@abey79 abey79 force-pushed the antoine/hierachical_dnd_example branch from b2338be to c77f28d Compare January 29, 2024 10:34
@abey79 abey79 marked this pull request as ready for review January 29, 2024 10:34
@abey79
Copy link
Copy Markdown
Collaborator Author

abey79 commented Jan 29, 2024

Done

[package]
name = "hierarchical_list_drag_and_drop"
version = "0.1.0"
authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"]
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

give yourself some credit :)

@@ -0,0 +1,311 @@
//! Helpers for drag and drop support. Works well in combination with [`crate::list_item::ListItem`].
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest we move this module into egui proper, for anyone to make use of!

@emilk emilk marked this pull request as draft February 1, 2024 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs and examples Improving and adding documentation and examples

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants