From 7a626f3b7b6871052e5fade697e120cfb7d726d7 Mon Sep 17 00:00:00 2001 From: Kaiden42 Date: Thu, 24 Sep 2020 16:31:39 +0200 Subject: Change label of `Toggler` to optional --- graphics/src/widget/toggler.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'graphics/src/widget/toggler.rs') 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, 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 -- cgit