summaryrefslogtreecommitdiffstats
path: root/native/src/widget/toggler.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2021-10-28 18:19:19 +0700
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2021-10-28 18:19:19 +0700
commit5cd744f9862c62ca441d4a4b3962d91e4360afbf (patch)
tree334d5062fdbc302a4281f88301c3e40cf228c985 /native/src/widget/toggler.rs
parent1c2792c0a0dc565f9dd9183ca8948331ec467590 (diff)
downloadiced-5cd744f9862c62ca441d4a4b3962d91e4360afbf.tar.gz
iced-5cd744f9862c62ca441d4a4b3962d91e4360afbf.tar.bz2
iced-5cd744f9862c62ca441d4a4b3962d91e4360afbf.zip
Implement `Widget::mouse_interaction` for `Toggler`
Diffstat (limited to 'native/src/widget/toggler.rs')
-rw-r--r--native/src/widget/toggler.rs13
1 files changed, 13 insertions, 0 deletions
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,