diff --git a/crates/egui/src/atomics/atom_layout.rs b/crates/egui/src/atomics/atom_layout.rs index c1b4d54b6..b9bc25e8a 100644 --- a/crates/egui/src/atomics/atom_layout.rs +++ b/crates/egui/src/atomics/atom_layout.rs @@ -107,12 +107,9 @@ impl<'a> AtomLayout<'a> { self } - /// Set the gap between atoms, unless the caller already set one. - /// - /// Used to apply a [`crate::widget_style::AtomLayoutStyle`] without overriding a per-widget - /// [`Self::gap`]. + /// Set the gap between atoms, unless one was already set. #[inline] - pub(crate) fn gap_if_unset(mut self, gap: f32) -> Self { + pub(crate) fn fallback_gap(mut self, gap: f32) -> Self { self.gap = self.gap.or(Some(gap)); self } diff --git a/crates/egui/src/widget_style/mod.rs b/crates/egui/src/widget_style/mod.rs index a681d0622..d76205107 100644 --- a/crates/egui/src/widget_style/mod.rs +++ b/crates/egui/src/widget_style/mod.rs @@ -91,7 +91,7 @@ impl AtomLayoutStyle { let layout = layout .min_size(self.min_size) - .gap_if_unset(self.gap) + .fallback_gap(self.gap) .frame(self.frame) .fallback_font(self.text_style.font_id.clone()) .fallback_text_color(self.text_style.color);