Implement Widget::mouse_interaction for PickList

This commit is contained in:
Héctor Ramón Jiménez 2021-10-28 16:42:32 +07:00
parent 8740891feb
commit 5a942ee7ee
No known key found for this signature in database
GPG key ID: 140CC052C94F138E

View file

@ -326,6 +326,22 @@ where
}
}
fn mouse_interaction(
&self,
layout: Layout<'_>,
_viewport: &Rectangle,
cursor_position: Point,
) -> mouse::Interaction {
let bounds = layout.bounds();
let is_mouse_over = bounds.contains(cursor_position);
if is_mouse_over {
mouse::Interaction::Pointer
} else {
mouse::Interaction::default()
}
}
fn draw(
&self,
renderer: &mut Renderer,