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