1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-29 21:00:03 -04:00
Files
egui/examples/styling_engine
Lucas Meurer 487c8f1dda Let the theme set a button's atom gap
`Button` hard-coded `spacing.icon_spacing` as the gap between its icon and
its text. A theme that gives a button its own metrics wants to set that gap
too, so it becomes a `ButtonStyle` field, overridden by `Button::gap`.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-25 09:49:37 +02:00
..
2026-08-25 09:49:37 +02:00

Example showing how the style engine work.

A custom StyleProvider<ButtonStyle> styles every button, using classes to tell them apart. The theme can be edited live in the left panel.

cargo run -p styling_engine