1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-08-02 03:28:28 -04:00

refactor: unify media control calls to MprisController sync

(cherry picked from commit 6cc574ea5b)
This commit is contained in:
purian23
2026-07-15 14:15:30 -04:00
parent db9fb0bd90
commit eca92898f9
7 changed files with 51 additions and 63 deletions
+4 -4
View File
@@ -129,7 +129,7 @@ BasePill {
if (deltaY > 0) {
MprisController.previousOrRewind();
} else {
activePlayer.next();
MprisController.next();
}
} else {
scrollAccumulatorY += deltaY;
@@ -137,7 +137,7 @@ BasePill {
if (scrollAccumulatorY > 0) {
MprisController.previousOrRewind();
} else {
activePlayer.next();
MprisController.next();
}
scrollAccumulatorY = 0;
}
@@ -266,7 +266,7 @@ BasePill {
} else if (mouse.button === Qt.MiddleButton) {
MprisController.previousOrRewind();
} else if (mouse.button === Qt.RightButton) {
activePlayer.next();
MprisController.next();
}
}
}
@@ -532,7 +532,7 @@ BasePill {
cursorShape: Qt.PointingHandCursor
onClicked: {
if (activePlayer) {
activePlayer.next();
MprisController.next();
}
}
}
@@ -662,11 +662,12 @@ Item {
weight: 500
}
MouseArea {
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: activePlayer && activePlayer.togglePlaying()
StateLayer {
id: playPauseArea
disabled: !root.activePlayer || !root.activePlayer.canTogglePlaying
stateColor: root.onAccent
cornerRadius: parent.radius
onClicked: root.activePlayer.togglePlaying()
}
ElevationShadow {
@@ -706,7 +707,7 @@ Item {
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: activePlayer && activePlayer.next()
onClicked: MprisController.next()
}
}
}
@@ -190,7 +190,7 @@ Card {
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: activePlayer?.next()
onClicked: MprisController.next()
}
}
}
@@ -1635,7 +1635,7 @@ Item {
enabled: MprisController.activePlayer?.canGoNext ?? false
hoverEnabled: enabled
cursorShape: enabled ? Qt.PointingHandCursor : Qt.ArrowCursor
onClicked: MprisController.activePlayer?.next()
onClicked: MprisController.next()
}
}
}