aboutsummaryrefslogtreecommitdiffstats
path: root/desktop/island/StatusPill.qml
diff options
context:
space:
mode:
Diffstat (limited to 'desktop/island/StatusPill.qml')
-rw-r--r--desktop/island/StatusPill.qml10
1 files changed, 9 insertions, 1 deletions
diff --git a/desktop/island/StatusPill.qml b/desktop/island/StatusPill.qml
index faf24dd..ab62da8 100644
--- a/desktop/island/StatusPill.qml
+++ b/desktop/island/StatusPill.qml
@@ -88,8 +88,16 @@ Capsule {
sourceSize: Qt.size(18, 18)
source: Qt.resolvedUrl("assets/" + Keyboard.flag)
+ // One switch per wheel notch (120). A touchpad sends many small
+ // deltas, and switching on each made the count erratic.
WheelHandler {
- onWheel: event => Keyboard.cycle(event.angleDelta.y > 0 ? "prev" : "next")
+ property real acc: 0
+ onWheel: event => {
+ acc += event.angleDelta.y;
+ if (Math.abs(acc) < 120) return;
+ Keyboard.cycle(acc > 0 ? "prev" : "next");
+ acc = 0;
+ }
}
}
}