summaryrefslogtreecommitdiffstats
path: root/native/src/widget/slider.rs
diff options
context:
space:
mode:
Diffstat (limited to 'native/src/widget/slider.rs')
-rw-r--r--native/src/widget/slider.rs23
1 files changed, 10 insertions, 13 deletions
diff --git a/native/src/widget/slider.rs b/native/src/widget/slider.rs
index 1feb7825..8cdfc3de 100644
--- a/native/src/widget/slider.rs
+++ b/native/src/widget/slider.rs
@@ -5,8 +5,7 @@
//! [`Slider`]: struct.Slider.html
//! [`State`]: struct.State.html
use crate::{
- input::{mouse, ButtonState},
- layout, Clipboard, Element, Event, Hasher, Layout, Length, Point,
+ layout, mouse, Clipboard, Element, Event, Hasher, Layout, Length, Point,
Rectangle, Size, Widget,
};
@@ -164,25 +163,23 @@ where
};
match event {
- Event::Mouse(mouse::Event::Input {
- button: mouse::Button::Left,
- state,
- }) => match state {
- ButtonState::Pressed => {
+ Event::Mouse(mouse_event) => match mouse_event {
+ mouse::Event::ButtonPressed(mouse::Button::Left) => {
if layout.bounds().contains(cursor_position) {
change();
self.state.is_dragging = true;
}
}
- ButtonState::Released => {
+ mouse::Event::ButtonReleased(mouse::Button::Left) => {
self.state.is_dragging = false;
}
- },
- Event::Mouse(mouse::Event::CursorMoved { .. }) => {
- if self.state.is_dragging {
- change();
+ mouse::Event::CursorMoved { .. } => {
+ if self.state.is_dragging {
+ change();
+ }
}
- }
+ _ => {}
+ },
_ => {}
}
}