summaryrefslogtreecommitdiffstats
path: root/widget/src
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-04-26 01:44:03 +0200
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-04-26 01:44:03 +0200
commit6d4155a5488da5b7fa3fd314f98c8f28c7202bd4 (patch)
treeaccc4e3c28c7a3b260e049ff7356fe91ca6dda43 /widget/src
parenteb49567791015be7f329d7d57d5f8c388abecd96 (diff)
downloadiced-6d4155a5488da5b7fa3fd314f98c8f28c7202bd4.tar.gz
iced-6d4155a5488da5b7fa3fd314f98c8f28c7202bd4.tar.bz2
iced-6d4155a5488da5b7fa3fd314f98c8f28c7202bd4.zip
Fix `Shift` scrolling for `scrollable` on macOS
Apparently, macOS inverts the scrolling axes automatically now. Was this a thing before, or did an update just break user space?
Diffstat (limited to 'widget/src')
-rw-r--r--widget/src/scrollable.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/widget/src/scrollable.rs b/widget/src/scrollable.rs
index f0a042cd..6fc00f87 100644
--- a/widget/src/scrollable.rs
+++ b/widget/src/scrollable.rs
@@ -564,7 +564,9 @@ where
let delta = match delta {
mouse::ScrollDelta::Lines { x, y } => {
// TODO: Configurable speed/friction (?)
- let movement = if state.keyboard_modifiers.shift() {
+ let movement = if !cfg!(target_os = "macos") // macOS automatically inverts the axes when Shift is pressed
+ && state.keyboard_modifiers.shift()
+ {
Vector::new(y, x)
} else {
Vector::new(x, y)