summaryrefslogtreecommitdiffstats
path: root/native
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-03-24 21:48:54 +0100
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-03-24 21:48:54 +0100
commitd6914d79a1867d517ce45d11ced8d4b31fdadcfc (patch)
tree6e78bbe1fbb7e75b365c02dc3f14313924dbbae6 /native
parent5e6970b6156928b010453f5199acfff0791ecf29 (diff)
downloadiced-d6914d79a1867d517ce45d11ced8d4b31fdadcfc.tar.gz
iced-d6914d79a1867d517ce45d11ced8d4b31fdadcfc.tar.bz2
iced-d6914d79a1867d517ce45d11ced8d4b31fdadcfc.zip
Rename `is_pressed` to `is_dragging` in `text_input`
Diffstat (limited to 'native')
-rw-r--r--native/src/widget/text_input.rs10
1 files 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<Value>,
last_click: Option<mouse::Click>,
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(),