summaryrefslogtreecommitdiffstats
path: root/native
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-11-12 00:56:50 +0100
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-11-12 00:56:50 +0100
commitc361fe48c7a92662046dd13cb08cb2157e0577be (patch)
tree3f648f11add68f8a5d874bc7b3f46b8374d0ba0a /native
parentfd275a2fee4c7bbea0dbefc0dc68b340cc003ad4 (diff)
downloadiced-c361fe48c7a92662046dd13cb08cb2157e0577be.tar.gz
iced-c361fe48c7a92662046dd13cb08cb2157e0577be.tar.bz2
iced-c361fe48c7a92662046dd13cb08cb2157e0577be.zip
Implement event capturing for `Slider`
Diffstat (limited to 'native')
-rw-r--r--native/src/widget/slider.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/native/src/widget/slider.rs b/native/src/widget/slider.rs
index 51edd56d..4e38fb86 100644
--- a/native/src/widget/slider.rs
+++ b/native/src/widget/slider.rs
@@ -234,6 +234,8 @@ where
if layout.bounds().contains(cursor_position) {
change();
self.state.is_dragging = true;
+
+ return event::Status::Captured;
}
}
mouse::Event::ButtonReleased(mouse::Button::Left) => {
@@ -242,11 +244,15 @@ where
messages.push(on_release);
}
self.state.is_dragging = false;
+
+ return event::Status::Captured;
}
}
mouse::Event::CursorMoved { .. } => {
if self.state.is_dragging {
change();
+
+ return event::Status::Captured;
}
}
_ => {}