From 5cd744f9862c62ca441d4a4b3962d91e4360afbf Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Thu, 28 Oct 2021 18:19:19 +0700 Subject: Implement `Widget::mouse_interaction` for `Toggler` --- native/src/widget/toggler.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'native/src/widget/toggler.rs') diff --git a/native/src/widget/toggler.rs b/native/src/widget/toggler.rs index 25ed95ca..a11d0307 100644 --- a/native/src/widget/toggler.rs +++ b/native/src/widget/toggler.rs @@ -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, -- cgit