Skip to content

Commit

Permalink
Single-selection drag-and-drop demos (#4879)
Browse files Browse the repository at this point in the history
### What

This PR implements a couple of single-selection drag-and-drop demo with
`ListItem`s in `re_ui_example`. One is flat, the other is hierarchical.
Most of it happens in `re_ui_example`, with some minimal support for
draggability in `ListItem`. The goal is to identify proper patterns (and
egui TODOs) for drag-and-drop support in the blueprint tree UI.

TODO:
- [x] iron out some bug where items disappear
- [x] highlight destination container
- [x] ascii art documentation for the drag areas
- [x] apply any change from:
    - emilk/egui#3859
    - emilk/egui#3860


https://github.com/rerun-io/rerun/assets/49431240/54588326-7e69-4d38-b16d-da17fc88b6b7

Contributes towards:
- #2652 

### Checklist
* [x] I have read and agree to [Contributor
Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and
the [Code of
Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md)
* [x] I've included a screenshot or gif (if applicable)
* [x] I have tested the web demo (if applicable):
* Using newly built examples:
[app.rerun.io](https://app.rerun.io/pr/4879/index.html)
* Using examples from latest `main` build:
[app.rerun.io](https://app.rerun.io/pr/4879/index.html?manifest_url=https://app.rerun.io/version/main/examples_manifest.json)
* Using full set of examples from `nightly` build:
[app.rerun.io](https://app.rerun.io/pr/4879/index.html?manifest_url=https://app.rerun.io/version/nightly/examples_manifest.json)
* [x] The PR title and labels are set such as to maximize their
usefulness for the next release's CHANGELOG

- [PR Build Summary](https://build.rerun.io/pr/4879)
- [Docs
preview](https://rerun.io/preview/94b9a81e7d5b2934b44919453ce2c92257b46a73/docs)
<!--DOCS-PREVIEW-->
- [Examples
preview](https://rerun.io/preview/94b9a81e7d5b2934b44919453ce2c92257b46a73/examples)
<!--EXAMPLES-PREVIEW-->
- [Recent benchmark results](https://build.rerun.io/graphs/crates.html)
- [Wasm size tracking](https://build.rerun.io/graphs/sizes.html)

---------

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
  • Loading branch information
abey79 and emilk authored Jan 25, 2024
1 parent 756793e commit f720d38
Show file tree
Hide file tree
Showing 5 changed files with 906 additions and 62 deletions.
41 changes: 11 additions & 30 deletions Cargo.lock

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

14 changes: 7 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -276,13 +276,13 @@ debug = true
# As a last resport, patch with a commit to our own repository.
# ALWAYS document what PR the commit hash is part of, or when it was merged into the upstream trunk.

ecolor = { git = "https://github.com/emilk/egui.git", rev = "2f9a4ca6e8434aaee3569095c0743b73cba26c44" } # egui master 2024-01-23
eframe = { git = "https://github.com/emilk/egui.git", rev = "2f9a4ca6e8434aaee3569095c0743b73cba26c44" } # egui master 2024-01-23
egui = { git = "https://github.com/emilk/egui.git", rev = "2f9a4ca6e8434aaee3569095c0743b73cba26c44" } # egui master 2024-01-23
egui_extras = { git = "https://github.com/emilk/egui.git", rev = "2f9a4ca6e8434aaee3569095c0743b73cba26c44" } # egui master 2024-01-23
egui_plot = { git = "https://github.com/emilk/egui.git", rev = "2f9a4ca6e8434aaee3569095c0743b73cba26c44" } # egui master 2024-01-23
egui-wgpu = { git = "https://github.com/emilk/egui.git", rev = "2f9a4ca6e8434aaee3569095c0743b73cba26c44" } # egui master 2024-01-23
emath = { git = "https://github.com/emilk/egui.git", rev = "2f9a4ca6e8434aaee3569095c0743b73cba26c44" } # egui master 2024-01-23
ecolor = { git = "https://github.com/emilk/egui.git", rev = "bcf032a08f7d7b510901a8f24a66ea12de6b2ac9" } # egui master 2024-01-24
eframe = { git = "https://github.com/emilk/egui.git", rev = "bcf032a08f7d7b510901a8f24a66ea12de6b2ac9" } # egui master 2024-01-24
egui = { git = "https://github.com/emilk/egui.git", rev = "bcf032a08f7d7b510901a8f24a66ea12de6b2ac9" } # egui master 2024-01-24
egui_extras = { git = "https://github.com/emilk/egui.git", rev = "bcf032a08f7d7b510901a8f24a66ea12de6b2ac9" } # egui master 2024-01-24
egui_plot = { git = "https://github.com/emilk/egui.git", rev = "bcf032a08f7d7b510901a8f24a66ea12de6b2ac9" } # egui master 2024-01-24
egui-wgpu = { git = "https://github.com/emilk/egui.git", rev = "bcf032a08f7d7b510901a8f24a66ea12de6b2ac9" } # egui master 2024-01-24
emath = { git = "https://github.com/emilk/egui.git", rev = "bcf032a08f7d7b510901a8f24a66ea12de6b2ac9" } # egui master 2024-01-24

# Useful while developing:
# ecolor = { path = "../../egui/crates/ecolor" }
Expand Down
4 changes: 3 additions & 1 deletion crates/re_ui/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ strum.workspace = true
sublime_fuzzy.workspace = true

[dev-dependencies]
re_log.workspace = true

eframe = { workspace = true, default-features = false, features = ["wgpu"] }
egui_tiles.workspace = true
re_log.workspace = true
rand.workspace = true
Loading

0 comments on commit f720d38

Please sign in to comment.