mirror of
https://github.com/emilk/egui.git
synced 2026-06-27 15:13:12 -04:00
* part of #7264 * based on https://github.com/emilk/egui/pull/8152 The resize fix allows use to really simplify how the Window Titlebar is rendered. Previously it was using some complex flow to calculate and allocate the height first and then render it later once we knew the windows final width. Since now windows can't shrink past their minimum content widths, I can just show the titlebar inline with the regular content, just outside of the `Resize` container so that it is always visible. This does change what the size of a window means. Before, size was just the size of the contents, while now size (e.g. via min_height) will include the Frames margin and outline, title bar and the contents. Also, the window label now truncates as you shrink the window (meaning windows can now be smaller than their label allows). --------- Co-authored-by: lucasmerlin <8009393+lucasmerlin@users.noreply.github.com>
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"