diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2025-07-16 15:31:56 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2025-07-16 15:31:56 +0800 |
| commit | d46258c0d2fc91491d4aa865ae35029a9d65cd91 (patch) | |
| tree | 6e30d4264c230c297cc4863e9ccffc07c2d00cfb | |
| parent | 4c7e5e83d68cba426c5f76fe351f79ab677a7c3c (diff) | |
mpris: change slider via scroll wheel instead of click
| -rw-r--r-- | bar/Mpris.qml | 20 |
1 files 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); } } } |
