From b7ea18c7514c18073a95cd16f9daa552284a1068 Mon Sep 17 00:00:00 2001 From: Asmir A Date: Mon, 8 Jun 2026 21:41:02 +0200 Subject: [PATCH] volume: reduce scroll sensitivity Use 2% steps and accumulate wheel deltas so high-res/inertial scrolling steps once per notch instead of firing per micro-event. Co-Authored-By: Claude Opus 4.8 --- widgets/Volume.qml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/widgets/Volume.qml b/widgets/Volume.qml index 3fdd5ab..9dbcea8 100644 --- a/widgets/Volume.qml +++ b/widgets/Volume.qml @@ -17,11 +17,20 @@ MouseArea { cursorShape: Qt.PointingHandCursor acceptedButtons: Qt.LeftButton + // accumulate raw wheel deltas so high-res / inertial scrolling doesn't + // fire a full step per micro-event; one notch (120 units) == one step + property real _wheelAccum: 0 + readonly property real _wheelStep: 0.02 + onClicked: { if (audio) audio.muted = !audio.muted; } onWheel: wheel => { if (!audio) return; + _wheelAccum += wheel.angleDelta.y; + const notches = Math.trunc(_wheelAccum / 120); + if (notches === 0) return; + _wheelAccum -= notches * 120; audio.volume = Math.max(0, Math.min(1, - audio.volume + (wheel.angleDelta.y > 0 ? 0.05 : -0.05))); + audio.volume + notches * _wheelStep)); } // keep the sink's audio properties live