From d46258c0d2fc91491d4aa865ae35029a9d65cd91 Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Wed, 16 Jul 2025 15:31:56 +0800 Subject: mpris: change slider via scroll wheel instead of click --- bar/Mpris.qml | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/bar/Mpris.qml b/bar/Mpris.qml index b213721..062b89c 100644 --- a/bar/Mpris.qml +++ b/bar/Mpris.qml @@ -67,21 +67,23 @@ Item { } } - onMoved: { - if (Math.round(root.activePlayer.position) !== Math.round(value)) { - root.activePlayer.position = value; - } - } + // onMoved: { + // if (Math.round(root.activePlayer.position) !== Math.round(value)) { + // root.activePlayer.position = value; + // } + // } MouseArea { anchors.fill: parent - acceptedButtons: Qt.MiddleButton | Qt.RightButton + acceptedButtons: Qt.MiddleButton | Qt.RightButton | Qt.LeftButton onClicked: mouse => { - if (mouse.button === Qt.MiddleButton) { + if (mouse.button === Qt.MiddleButton) root.activePlayer?.togglePlaying(); - } else if (mouse.button === Qt.RightButton) { + else if (mouse.button === Qt.RightButton) root.activePlayer?.next(); - } + } + onWheel: mouse => { + root.activePlayer?.seek(-mouse.angleDelta.y / 25); } } } -- cgit v1.2.3