diff options
| author | 2021-10-28 16:42:32 +0700 | |
|---|---|---|
| committer | 2021-10-28 16:42:32 +0700 | |
| commit | 5a942ee7ee55c8aa30b48b289661aaec81418f44 (patch) | |
| tree | a56e24a2c27eb3d4acb72e9dd2cf1382d0a2cf8f /native/src | |
| parent | 8740891feb4439e700276a851dcfb660475ed047 (diff) | |
| download | iced-5a942ee7ee55c8aa30b48b289661aaec81418f44.tar.gz iced-5a942ee7ee55c8aa30b48b289661aaec81418f44.tar.bz2 iced-5a942ee7ee55c8aa30b48b289661aaec81418f44.zip  | |
Implement `Widget::mouse_interaction` for `PickList`
Diffstat (limited to '')
| -rw-r--r-- | native/src/widget/pick_list.rs | 16 | 
1 files changed, 16 insertions, 0 deletions
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,  | 
