From 8d6c2580f4a5391e36fa4857f09ba044adcdddb6 Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Wed, 8 Feb 2023 08:42:00 +0100 Subject: [PATCH] Add Checkbox::without_text Closes https://github.com/emilk/egui/pull/2508 --- crates/egui/src/widgets/button.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/egui/src/widgets/button.rs b/crates/egui/src/widgets/button.rs index 8f4ad6bb..a7fa6781 100644 --- a/crates/egui/src/widgets/button.rs +++ b/crates/egui/src/widgets/button.rs @@ -269,6 +269,10 @@ impl<'a> Checkbox<'a> { text: text.into(), } } + + pub fn without_text(checked: &'a mut bool) -> Self { + Self::new(checked, WidgetText::default()) + } } impl<'a> Widget for Checkbox<'a> {