summaryrefslogtreecommitdiffstats
path: root/native/src/input
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector0193@gmail.com>2019-11-03 05:19:12 +0100
committerLibravatar GitHub <noreply@github.com>2019-11-03 05:19:12 +0100
commit0ea911ae36bbde8c288f7ae1ba8a0049b696d7c4 (patch)
tree929cb493b674512520f1b6a92f86d7a09e5801f6 /native/src/input
parentde3c87b9a793c0d0799948e16ad1b14e5b4892ba (diff)
parent022dc0139b7437f167a8d3ae483bf8e83f1dab04 (diff)
downloadiced-0ea911ae36bbde8c288f7ae1ba8a0049b696d7c4.tar.gz
iced-0ea911ae36bbde8c288f7ae1ba8a0049b696d7c4.tar.bz2
iced-0ea911ae36bbde8c288f7ae1ba8a0049b696d7c4.zip
Merge pull request #35 from hecrj/feature/scrollables
Scrollable widget
Diffstat (limited to 'native/src/input')
-rw-r--r--native/src/input/mouse.rs2
-rw-r--r--native/src/input/mouse/event.rs17
2 files changed, 15 insertions, 4 deletions
diff --git a/native/src/input/mouse.rs b/native/src/input/mouse.rs
index d37f5b96..69dc6b4c 100644
--- a/native/src/input/mouse.rs
+++ b/native/src/input/mouse.rs
@@ -3,4 +3,4 @@ mod button;
mod event;
pub use button::Button;
-pub use event::Event;
+pub use event::{Event, ScrollDelta};
diff --git a/native/src/input/mouse/event.rs b/native/src/input/mouse/event.rs
index 7b68208f..478f9b4d 100644
--- a/native/src/input/mouse/event.rs
+++ b/native/src/input/mouse/event.rs
@@ -34,11 +34,22 @@ pub enum Event {
},
/// The mouse wheel was scrolled.
- WheelScrolled {
+ WheelScrolled { delta: ScrollDelta },
+}
+
+#[derive(Debug, Clone, Copy, PartialEq)]
+pub enum ScrollDelta {
+ Lines {
/// The number of horizontal lines scrolled
- delta_x: f32,
+ x: f32,
/// The number of vertical lines scrolled
- delta_y: f32,
+ y: f32,
+ },
+ Pixels {
+ /// The number of horizontal pixels scrolled
+ x: f32,
+ /// The number of vertical pixels scrolled
+ y: f32,
},
}