Draw checkbox in iced_wgpu

This commit is contained in:
Héctor Ramón Jiménez 2019-10-13 18:10:12 +02:00
parent 8c3dabb5a1
commit ccc463a7c0
2 changed files with 95 additions and 11 deletions

View file

@ -26,9 +26,7 @@ where
button: mouse::Button::Left,
state: ButtonState::Pressed,
}) => {
let mouse_over = layout
.children()
.any(|child| child.bounds().contains(cursor_position));
let mouse_over = layout.bounds().contains(cursor_position);
if mouse_over {
messages.push((self.on_toggle)(!self.is_checked));