mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-10-23 19:54:02 -04:00
Added ability to play/pause media and mute audio by middle clicking when (#3332)
using the island mode
This commit is contained in:
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;
|
||||
|
||||
Reference in new issue
Block a user