summaryrefslogtreecommitdiffstats
path: root/native/src/widget
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2021-10-20 18:45:45 +0700
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2021-10-20 18:45:45 +0700
commitcc560aca181202e827bfdc9afb6fc9fbe42f54d6 (patch)
treefdbfc674ba01c016cd74118231186c6db9be33d2 /native/src/widget
parente914888f57394e4b67b40e42f1ad9df4ae8147e6 (diff)
downloadiced-cc560aca181202e827bfdc9afb6fc9fbe42f54d6.tar.gz
iced-cc560aca181202e827bfdc9afb6fc9fbe42f54d6.tar.bz2
iced-cc560aca181202e827bfdc9afb6fc9fbe42f54d6.zip
Implement `Widget::mouse_interaction` for `TextInput`
Diffstat (limited to 'native/src/widget')
-rw-r--r--native/src/widget/text_input.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/native/src/widget/text_input.rs b/native/src/widget/text_input.rs
index 22cb9092..0a2b19a3 100644
--- a/native/src/widget/text_input.rs
+++ b/native/src/widget/text_input.rs
@@ -580,6 +580,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::Text
+ } else {
+ mouse::Interaction::default()
+ }
+ }
+
fn draw(
&self,
renderer: &mut Renderer,