mirror of
https://github.com/emilk/egui.git
synced 2026-06-27 15:13:12 -04:00
* Closes #4534 This PR: - Introduces `Ui::stack()`, which returns the `UiStack` structure providing information on the current `Ui` hierarchy. - **BREAKING**: `Ui::new()` now takes a `UiStackInfo` argument, which is used to populate some of this `Ui`'s `UiStack`'s fields. - **BREAKING**: `Ui::child_ui()` and `Ui::child_ui_with_id_source()` now take an `Option<UiStackInfo>` argument, which is used to populate some of the children `Ui`'s `UiStack`'s fields. - New `Area::kind()` builder function, to set the `UiStackKind` value of the `Area`'s `Ui`. - Adds a (minimalistic) demo to egui demo (in the "Misc Demos" window). - Adds a more thorough `test_ui_stack` test/playground demo. TODO: - [x] benchmarks - [x] add example to demo Future work: - Add `UiStackKind` and related support for more container (e.g. `CollapsingHeader`, etc.) - Add a tag/property system that would allow adding arbitrary data to a stack node. This data could then be queried by nested `Ui`s. Probably needed for #3284. - Add support to track columnar layouts. --------- Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
28 lines
595 B
TOML
28 lines
595 B
TOML
[package]
|
|
name = "test_ui_stack"
|
|
version = "0.1.0"
|
|
authors = ["Antoine Beyeler <abeyeler@gmail.com>"]
|
|
license = "MIT OR Apache-2.0"
|
|
edition = "2021"
|
|
rust-version = "1.76"
|
|
publish = false
|
|
|
|
[lints]
|
|
workspace = true
|
|
|
|
|
|
[dependencies]
|
|
eframe = { workspace = true, features = [
|
|
"default",
|
|
"persistence",
|
|
"__screenshot", # __screenshot is so we can dump a screenshot using EFRAME_SCREENSHOT_TO
|
|
] }
|
|
|
|
# For image support:
|
|
egui_extras = { workspace = true, features = ["default", "image"] }
|
|
|
|
env_logger = { version = "0.10", default-features = false, features = [
|
|
"auto-color",
|
|
"humantime",
|
|
] }
|