Implement Widget::mouse_interaction for Checkbox

This commit is contained in:
Héctor Ramón Jiménez 2021-10-21 19:07:30 +07:00
parent 1397be38ca
commit e7ae442231
No known key found for this signature in database
GPG key ID: 140CC052C94F138E

View file

@ -186,6 +186,19 @@ where
event::Status::Ignored
}
fn mouse_interaction(
&self,
layout: Layout<'_>,
_viewport: &Rectangle,
cursor_position: Point,
) -> mouse::Interaction {
if layout.bounds().contains(cursor_position) {
mouse::Interaction::Pointer
} else {
mouse::Interaction::default()
}
}
fn draw(
&self,
renderer: &mut Renderer,