egui/crates/egui_demo_app/src
Lucas Meurer 3fdc5641aa
Group AccessKit nodes by `Ui` (#7386)
* closes https://github.com/emilk/egui/issues/5674

This changes egui to create an AccessKit node for each `Ui`. I'm not
sure if this alone will directly improve accessibility, but it should
make it easier to create the correct parent / child relations (e.g.
grouping menus as children of menu buttons).
Instead of having a global stack of parent ids, they are now passed via
a parent_id field in `UiBuilder`.

If having all these `GenericContainer` nodes somehow is bad for
accessibility, the PR could also be changed to only create nodes if
there is actually some accessibility info with it (the relevant is
currently commented-out in the PR). But I think screen readers should
just ignore these nodes, so it should be fine? We could also use this as
motivation to git red of some unnecessary wrapped `Ui`s, e.g.
CentralPanel creates 3 Uis when 2 should be enough (the initial Ui and a
Frame, maybe we could even only show the `Frame` if we can give it an
UiBuilder and somehow show the Frame with `Ui::new`).

Here is a screenshot from the accessibility inspector
(https://github.com/emilk/egui/pull/7368) with this PR:

<img width="431" height="744" alt="Screenshot 2025-07-24 at 12 09 55"
src="https://github.com/user-attachments/assets/6c4e5ff6-5c38-450e-9500-0776c9018d8c"
/>

Without this PR:


https://github.com/user-attachments/assets/270e32fc-9c7a-4dad-8c90-7638c487a602
2025-10-08 11:30:32 +02:00
..
apps Inline log format args (#7600) 2025-10-07 16:14:43 +02:00
accessibility_inspector.rs Group AccessKit nodes by `Ui` (#7386) 2025-10-08 11:30:32 +02:00
backend_panel.rs Add `Context::cumulative_frame_nr` (#7278) 2025-06-30 13:29:56 +02:00
frame_history.rs More even text kerning (#7431) 2025-09-08 17:29:41 +02:00
lib.rs Accessibility inspector plugin (#7368) 2025-10-07 14:39:49 +02:00
main.rs Improve error message when failing to run egui_demo_app (#7567) 2025-09-29 11:12:03 +02:00
web.rs Enable more clippy lints (#6853) 2025-04-24 17:32:50 +02:00
wrap_app.rs Accessibility inspector plugin (#7368) 2025-10-07 14:39:49 +02:00