1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-06-16 08:05:19 -04:00

feat(media-control): support scroll and right-click on audio output devices in media popout (#2615)

* feat(media-control): support scroll and right-click on audio output devices in media popout

* feat(media-control): make device list volume scrolling optional
This commit is contained in:
Huỳnh Thiện Lộc
2026-06-14 04:51:03 +07:00
committed by GitHub
parent 3701b3d7a3
commit 9d1a81c93c
7 changed files with 86 additions and 7 deletions
+21 -1
View File
@@ -866,7 +866,27 @@ Item {
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: {
acceptedButtons: Qt.LeftButton | Qt.RightButton
onPressed: mouse => {
if (mouse.button === Qt.RightButton) {
mouse.accepted = true;
}
}
onWheel: wheelEvent => {
const delta = wheelEvent.angleDelta.y;
if (delta !== 0) {
AudioService.cycleAudioOutputDirection(delta < 0);
wheelEvent.accepted = true;
}
}
onClicked: mouse => {
if (mouse.button === Qt.RightButton) {
if (AudioService.sink?.audio) {
SessionData.suppressOSDTemporarily();
AudioService.sink.audio.muted = !AudioService.sink.audio.muted;
}
return;
}
if (devicesExpanded) {
const sinks = AudioService.getAvailableSinks();
if (sinks && sinks.length > 1) {