egui/crates
Antoine Beyeler a28792194d
Introduce `UiStack` (#4588)
* 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>
2024-06-04 10:12:23 +02:00
..
ecolor Move dependencies to workspace (#4495) 2024-05-14 11:02:49 +02:00
eframe Enforce eframe errors are `Send` and `Sync` (#4574) 2024-05-29 13:13:00 +02:00
egui Introduce `UiStack` (#4588) 2024-06-04 10:12:23 +02:00
egui-wgpu Revert update to wgpu 0.20 => downgrade to wgpu 0.19.1 (#4559) 2024-05-28 14:40:43 +02:00
egui-winit Do no use the ahash reimport (#4504) 2024-05-27 16:24:50 +02:00
egui_demo_app Replace some `...` with `…` 2024-05-29 11:48:50 +02:00
egui_demo_lib Introduce `UiStack` (#4588) 2024-06-04 10:12:23 +02:00
egui_extras Introduce `UiStack` (#4588) 2024-06-04 10:12:23 +02:00
egui_glow Do no use the ahash reimport (#4504) 2024-05-27 16:24:50 +02:00
egui_plot Introduce `UiStack` (#4588) 2024-06-04 10:12:23 +02:00
egui_web Fix typos (#2866) 2023-04-18 15:52:45 +02:00
emath `Rect::intersects_ray`: another bug fix (#4597) 2024-05-31 17:28:38 +02:00
epaint Bug fix: ui opacity and gray-out not affecting strokes (#4581) 2024-05-29 22:37:55 +02:00