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
Draft
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions examples/hierachical_list_drag_and_drop/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[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 :)

license = "MIT OR Apache-2.0"
edition = "2021"
rust-version = "1.72"
publish = false


[dependencies]
eframe = { path = "../../crates/eframe", features = [
"__screenshot", # __screenshot is so we can dump a screenshot using EFRAME_SCREENSHOT_TO
] }


env_logger = { version = "0.10", default-features = false, features = [
"auto-color",
"humantime",
] }

rand = "0.8.5"
7 changes: 7 additions & 0 deletions examples/hierachical_list_drag_and_drop/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Example showing how to implement drag-and-drop in a hierarchical list

```sh
cargo run -p hierarchical_drag_and_drop
```

![](screenshot.png)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading