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

Dragging in and out of nested items #11

Open
trumank opened this issue Aug 11, 2023 · 1 comment
Open

Dragging in and out of nested items #11

trumank opened this issue Aug 11, 2023 · 1 comment
Labels
egui_dnd enhancement New feature or request

Comments

@trumank
Copy link

trumank commented Aug 11, 2023

I have an interface very similar to the nested example and would like to be able to drag items between layers. I'm imagining creating a dnd widget over an iterator that returns a flattened version of the tree, but there would need to be a way to indicate which elements fall inside a nested a container.

Are there any existing ideas or plans to add this functionality? I might take a swing at it but would have to familiarize myself with the crate internals.

@lucasmerlin
Copy link
Owner

That would be really cool. If we support that, we should also be able to support dragging between different lists.

I imagine there would need to be some sort of global / parent drag drop context where the different DragDropUis register themselves and then when dragging an item it checks in which DragDropUi it should be dropped.

I think ideally this would be a separate module without having to make many changes to state.rs but that might not be possible. Feel free to take a swing at it, let me know if you need anything!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
egui_dnd enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants