Change label of Toggler to optional
This commit is contained in:
parent
aa18a6e0d5
commit
7a626f3b7b
3 changed files with 53 additions and 32 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue