Allow Checkbox style to change based on its state

This commit is contained in:
Héctor Ramón Jiménez 2020-01-08 03:30:15 +01:00
parent 08faaaf623
commit cae4463e83
3 changed files with 20 additions and 13 deletions

View file

@ -21,9 +21,9 @@ impl checkbox::Renderer for Renderer {
style_sheet: &Self::Style,
) -> Self::Output {
let style = if is_mouse_over {
style_sheet.hovered()
style_sheet.hovered(is_checked)
} else {
style_sheet.active()
style_sheet.active(is_checked)
};
let checkbox = Primitive::Quad {