1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-29 12:50:04 -04:00

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>
This commit is contained in:
Lucas Meurer
2026-08-25 09:27:05 +02:00
parent 46fe9d73fa
commit 487c8f1dda
5 changed files with 17 additions and 0 deletions

View File

@@ -69,6 +69,7 @@ impl StyleProvider<ButtonStyle> for MyTheme {
.inner_margin(8),
text_style: base.text,
min_size: args.style.spacing.interact_size,
gap: args.style.spacing.icon_spacing,
}
}
}