diff options
author | 2021-10-20 18:45:45 +0700 | |
---|---|---|
committer | 2021-10-20 18:45:45 +0700 | |
commit | cc560aca181202e827bfdc9afb6fc9fbe42f54d6 (patch) | |
tree | fdbfc674ba01c016cd74118231186c6db9be33d2 /native/src/widget | |
parent | e914888f57394e4b67b40e42f1ad9df4ae8147e6 (diff) | |
download | iced-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.rs | 13 |
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, |