diff options
author | 2021-10-21 19:07:30 +0700 | |
---|---|---|
committer | 2021-10-21 19:07:30 +0700 | |
commit | e7ae4422312e045a1fbbaa7655d4bf78ca6954a8 (patch) | |
tree | 5a5d2ff137c410762caef481159f07c79d438c78 /native | |
parent | 1397be38ca2caaf5c49ca51e164a28b63f9e461b (diff) | |
download | iced-e7ae4422312e045a1fbbaa7655d4bf78ca6954a8.tar.gz iced-e7ae4422312e045a1fbbaa7655d4bf78ca6954a8.tar.bz2 iced-e7ae4422312e045a1fbbaa7655d4bf78ca6954a8.zip |
Implement `Widget::mouse_interaction` for `Checkbox`
Diffstat (limited to 'native')
-rw-r--r-- | native/src/widget/checkbox.rs | 13 |
1 files changed, 13 insertions, 0 deletions
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, |