From 5a942ee7ee55c8aa30b48b289661aaec81418f44 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Thu, 28 Oct 2021 16:42:32 +0700 Subject: Implement `Widget::mouse_interaction` for `PickList` --- native/src/widget/pick_list.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'native/src') diff --git a/native/src/widget/pick_list.rs b/native/src/widget/pick_list.rs index 57375a72..6fe5feb7 100644 --- a/native/src/widget/pick_list.rs +++ b/native/src/widget/pick_list.rs @@ -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, -- cgit