From d6914d79a1867d517ce45d11ced8d4b31fdadcfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Ram=C3=B3n=20Jim=C3=A9nez?= Date: Tue, 24 Mar 2020 21:48:54 +0100 Subject: [PATCH] Rename `is_pressed` to `is_dragging` in `text_input` --- native/src/widget/text_input.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/native/src/widget/text_input.rs b/native/src/widget/text_input.rs index dddabfdf..b0dc9f9a 100644 --- a/native/src/widget/text_input.rs +++ b/native/src/widget/text_input.rs @@ -283,17 +283,17 @@ where self.state.last_click = Some(click); } - self.state.is_pressed = is_clicked; + self.state.is_dragging = is_clicked; self.state.is_focused = is_clicked; } Event::Mouse(mouse::Event::Input { button: mouse::Button::Left, state: ButtonState::Released, }) => { - self.state.is_pressed = false; + self.state.is_dragging = false; } Event::Mouse(mouse::Event::CursorMoved { x, .. }) => { - if self.state.is_pressed { + if self.state.is_dragging { let text_layout = layout.children().next().unwrap(); let target = x - text_layout.bounds().x; @@ -611,7 +611,7 @@ where #[derive(Debug, Default, Clone)] pub struct State { is_focused: bool, - is_pressed: bool, + is_dragging: bool, is_pasting: Option, last_click: Option, cursor: Cursor, @@ -632,7 +632,7 @@ impl State { pub fn focused() -> Self { Self { is_focused: true, - is_pressed: false, + is_dragging: false, is_pasting: None, last_click: None, cursor: Cursor::default(),