Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

abey79
Copy link
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
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
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
Collaborator Author

abey79 commented Jan 29, 2024

Done

[package]
name = "hierarchical_list_drag_and_drop"
version = "0.1.0"
authors = ["Emil Ernerfeldt <[email protected]>"]
Copy link
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
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