From cc560aca181202e827bfdc9afb6fc9fbe42f54d6 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Wed, 20 Oct 2021 18:45:45 +0700 Subject: Implement `Widget::mouse_interaction` for `TextInput` --- native/src/widget/text_input.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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, -- cgit