summaryrefslogtreecommitdiffstats
path: root/graphics
diff options
context:
space:
mode:
authorLibravatar Kaiden42 <gitlab@tinysn.com>2020-09-24 16:31:39 +0200
committerLibravatar Héctor Ramón <hector@lich.io>2021-06-03 20:21:55 +0700
commit7a626f3b7b6871052e5fade697e120cfb7d726d7 (patch)
treef24de5b3ec7e9047138ed628ac6e2bddeedbd1cd /graphics
parentaa18a6e0d5550a83510aaf38a2b01d4a5fa56ccd (diff)
downloadiced-7a626f3b7b6871052e5fade697e120cfb7d726d7.tar.gz
iced-7a626f3b7b6871052e5fade697e120cfb7d726d7.tar.bz2
iced-7a626f3b7b6871052e5fade697e120cfb7d726d7.zip
Change label of `Toggler` to optional
Diffstat (limited to 'graphics')
-rw-r--r--graphics/src/widget/toggler.rs9
1 files changed, 7 insertions, 2 deletions
diff --git a/graphics/src/widget/toggler.rs b/graphics/src/widget/toggler.rs
index a258443e..852d18ee 100644
--- a/graphics/src/widget/toggler.rs
+++ b/graphics/src/widget/toggler.rs
@@ -33,7 +33,7 @@ where
bounds: Rectangle,
is_active: bool,
is_mouse_over: bool,
- (label, _): Self::Output,
+ label: Option<Self::Output>,
style_sheet: &Self::Style,
) -> Self::Output {
let style = if is_mouse_over {
@@ -82,7 +82,12 @@ where
(
Primitive::Group {
- primitives: vec![label, toggler_background, toggler_foreground],
+ primitives: match label {
+ Some((l, _)) => {
+ vec![l, toggler_background, toggler_foreground]
+ }
+ None => vec![toggler_background, toggler_foreground],
+ },
},
if is_mouse_over {
mouse::Interaction::Pointer