1
0
mirror of https://github.com/emilk/egui.git synced 2026-06-26 22:53:14 -04:00

Allow Atoms in Ui::small_button (#8159)

* part of #7264
This commit is contained in:
Lucas Meurer
2026-05-13 12:10:38 +02:00
committed by GitHub
parent 1280495301
commit 571d366056

View File

@@ -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<WidgetText>) -> 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.