Added ability to play/pause media and mute audio by middle clicking when (#3332)

using the island mode
This commit is contained in:
Kaushik Rawat authored and GitHub committed 2026-09-05 18:04:44 -04:00
1 parent 5baef07048
commit f9eb2381b0
1 file changed
+26 -2
@@ -374,7 +374,19 @@ Item {
height: root.height
enabled: !item.isClock
controller: root.controller
onClicked: root.activateGroup(item.groupId)
acceptedButtons: Qt.LeftButton | Qt.MiddleButton
onClicked: (event) => {
if (event.button === Qt.MiddleButton) {
if (item.isMedia && root.controller.mediaAvailable && MprisController.activePlayer?.canTogglePlaying)
MprisController.activePlayer.togglePlaying();
if (item.isVolume && AudioService.sink?.audio) {
SessionData.suppressOSDTemporarily();
AudioService.toggleMute();
}
return;
}
root.activateGroup(item.groupId)
}
onWheel: wheel => {
if (!item.isVolume && !item.isBrightness)
return;
@@ -568,7 +580,19 @@ Item {
height: parent.height + item.leadPad + item.trailPad
enabled: !item.isClock
controller: root.controller
onClicked: root.activateGroup(item.groupId)
acceptedButtons: Qt.LeftButton | Qt.MiddleButton
onClicked: (event) => {
if (event.button === Qt.MiddleButton) {
if (item.isMedia && root.controller.mediaAvailable && MprisController.activePlayer?.canTogglePlaying)
MprisController.activePlayer.togglePlaying();
if (item.isVolume && AudioService.sink?.audio) {
SessionData.suppressOSDTemporarily();
AudioService.toggleMute();
}
return;
}
root.activateGroup(item.groupId)
}
onWheel: wheel => {
if (!item.isVolume && !item.isBrightness)
return;