summaryrefslogtreecommitdiffstats
path: root/native/src/widget/scrollable.rs
diff options
context:
space:
mode:
Diffstat (limited to 'native/src/widget/scrollable.rs')
-rw-r--r--native/src/widget/scrollable.rs15
1 files changed, 10 insertions, 5 deletions
diff --git a/native/src/widget/scrollable.rs b/native/src/widget/scrollable.rs
index 76d12124..8a82be4f 100644
--- a/native/src/widget/scrollable.rs
+++ b/native/src/widget/scrollable.rs
@@ -64,11 +64,16 @@ where
// TODO: Event capture. Nested scrollables should capture scroll events.
if is_mouse_over {
match event {
- Event::Mouse(mouse::Event::WheelScrolled {
- delta_y, ..
- }) => {
- // TODO: Configurable speed (?)
- self.state.scroll(delta_y * 15.0, bounds, content_bounds);
+ Event::Mouse(mouse::Event::WheelScrolled { delta }) => {
+ match delta {
+ mouse::ScrollDelta::Lines { y, .. } => {
+ // TODO: Configurable speed (?)
+ self.state.scroll(y * 15.0, bounds, content_bounds);
+ }
+ mouse::ScrollDelta::Pixels { y, .. } => {
+ self.state.scroll(y, bounds, content_bounds);
+ }
+ }
}
_ => {}
}