From e7ae4422312e045a1fbbaa7655d4bf78ca6954a8 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Thu, 21 Oct 2021 19:07:30 +0700 Subject: Implement `Widget::mouse_interaction` for `Checkbox` --- native/src/widget/checkbox.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'native/src') diff --git a/native/src/widget/checkbox.rs b/native/src/widget/checkbox.rs index babd74a5..83bc2aa3 100644 --- a/native/src/widget/checkbox.rs +++ b/native/src/widget/checkbox.rs @@ -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, -- cgit