Implement Widget::mouse_interaction for Toggler

This commit is contained in:
Héctor Ramón Jiménez 2021-10-28 18:19:19 +07:00
parent 1c2792c0a0
commit 5cd744f986
No known key found for this signature in database
GPG key ID: 140CC052C94F138E

View file

@ -189,6 +189,19 @@ where
}
}
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,