This adds a custom Node struct with proper support for egui types (`Key`, `Modifiers`, `egui::Event`, `Rect`) instead of needing to use the kittest / accesskit types. I also changed the `click` function to do a proper mouse move / mouse down instead of the accesskit click. Also added `accesskit_click` to trigger the accesskit event. This resulted in some changed snapshots, since the elements are now hovered. Also renamed `press_key` to `key_press` for consistency with `key_down/key_up`. Also removed the Deref to the AccessKit Node, to make it clearer when to expect egui and when to expect accesskit types. * Closes #5705 * [x] I have followed the instructions in the PR template |
||
|---|---|---|
| .. | ||
| benches | ||
| data | ||
| src | ||
| tests/snapshots | ||
| Cargo.toml | ||
| README.md | ||
README.md
egui demo library
This crate contains example code for egui.
The demo library is a separate crate for three reasons:
- To ensure it only uses the public
eguiapi. - To remove the amount of code in
eguiproper. - To make it easy for 3rd party egui integrations to use it for tests.
This crate also contains benchmarks for egui. Run them with
# Run all benchmarks
cargo bench -p egui_demo_lib
# Run a single benchmark
cargo bench -p egui_demo_lib "benchmark name"
# Profile benchmarks with cargo-flamegraph (--root flag is necessary for MacOS)
CARGO_PROFILE_BENCH_DEBUG=true cargo flamegraph --bench benchmark --root -p egui_demo_lib -- --bench "benchmark name"
# Profile with cargo-instruments
CARGO_PROFILE_BENCH_DEBUG=true cargo instruments --profile bench --bench benchmark -p egui_demo_lib -t time -- --bench "benchmark name"