From 571d3660566bc2c6a75a51377128d018fec6277a Mon Sep 17 00:00:00 2001 From: Lucas Meurer Date: Wed, 13 May 2026 12:10:38 +0200 Subject: [PATCH] Allow `Atoms` in `Ui::small_button` (#8159) * part of #7264 --- crates/egui/src/ui.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/egui/src/ui.rs b/crates/egui/src/ui.rs index 9e7208fc3..81508e940 100644 --- a/crates/egui/src/ui.rs +++ b/crates/egui/src/ui.rs @@ -1858,10 +1858,10 @@ impl Ui { /// /// Usage: `if ui.small_button("Click me").clicked() { … }` /// - /// Shortcut for `add(Button::new(text).small())` + /// Shortcut for `add(Button::new(atoms).small())` #[must_use = "You should check if the user clicked this with `if ui.small_button(…).clicked() { … } "] - pub fn small_button(&mut self, text: impl Into) -> Response { - Button::new(text).small().ui(self) + pub fn small_button<'a>(&mut self, atoms: impl IntoAtoms<'a>) -> Response { + Button::new(atoms).small().ui(self) } /// Show a checkbox.