mirror of
https://github.com/emilk/egui.git
synced 2026-08-31 13: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:
@@ -107,6 +107,13 @@ impl<'a> AtomLayout<'a> {
|
||||
self
|
||||
}
|
||||
|
||||
/// Set the gap between atoms, unless [`Self::gap`] already set one.
|
||||
#[inline]
|
||||
pub fn fallback_gap(mut self, gap: f32) -> Self {
|
||||
self.gap.get_or_insert(gap);
|
||||
self
|
||||
}
|
||||
|
||||
/// Set the [`Frame`].
|
||||
#[inline]
|
||||
pub fn frame(mut self, frame: Frame) -> Self {
|
||||
|
||||
Reference in New Issue
Block a user