summaryrefslogtreecommitdiffstats
path: root/native/src/widget/slider.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-03-19 12:17:16 +0100
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-03-19 12:17:16 +0100
commitd3572e1b819ff4d40de4f39f48eab71b9d0d4d5e (patch)
tree80d635749e4941004055f16a7ca5c35e11f3caa9 /native/src/widget/slider.rs
parente19a07d40049f40f36d879a498fab4ce63778b27 (diff)
downloadiced-d3572e1b819ff4d40de4f39f48eab71b9d0d4d5e.tar.gz
iced-d3572e1b819ff4d40de4f39f48eab71b9d0d4d5e.tar.bz2
iced-d3572e1b819ff4d40de4f39f48eab71b9d0d4d5e.zip
Turn `Touch` into a struct and add finger id
Diffstat (limited to 'native/src/widget/slider.rs')
-rw-r--r--native/src/widget/slider.rs17
1 files changed, 13 insertions, 4 deletions
diff --git a/native/src/widget/slider.rs b/native/src/widget/slider.rs
index 95f63921..c98cebb6 100644
--- a/native/src/widget/slider.rs
+++ b/native/src/widget/slider.rs
@@ -5,7 +5,7 @@
//! [`Slider`]: struct.Slider.html
//! [`State`]: struct.State.html
use crate::{
- input::{mouse, touch::Touch, ButtonState},
+ input::{mouse, touch, ButtonState, Touch},
layout, Clipboard, Element, Event, Hasher, Layout, Length, Point,
Rectangle, Size, Widget,
};
@@ -168,7 +168,10 @@ where
button: mouse::Button::Left,
state: ButtonState::Pressed,
})
- | Event::Touch(Touch::Started { .. }) => {
+ | Event::Touch(Touch {
+ phase: touch::Phase::Started,
+ ..
+ }) => {
if layout.bounds().contains(cursor_position) {
change();
self.state.is_dragging = true;
@@ -178,11 +181,17 @@ where
button: mouse::Button::Left,
state: ButtonState::Released,
})
- | Event::Touch(Touch::Ended { .. }) => {
+ | Event::Touch(Touch {
+ phase: touch::Phase::Ended,
+ ..
+ }) => {
self.state.is_dragging = false;
}
Event::Mouse(mouse::Event::CursorMoved { .. })
- | Event::Touch(Touch::Moved { .. }) => {
+ | Event::Touch(Touch {
+ phase: touch::Phase::Moved,
+ ..
+ }) => {
if self.state.is_dragging {
change();
}