1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-06-19 17:45:21 -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
@@ -383,7 +383,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 => {
if (SettingsData.audioDeviceScrollVolumeEnabled && wheelEvent.x >= deviceMouseArea.width / 2) {
AudioService.handleNodeVolumeWheel(modelData, wheelEvent);
} else {
wheelEvent.accepted = false;
}
}
onClicked: mouse => {
if (mouse.button === Qt.RightButton) {
if (modelData && modelData.audio) {
SessionData.suppressOSDTemporarily();
modelData.audio.muted = !modelData.audio.muted;
}
return;
}
if (modelData && modelData.name) {
AudioService.setDefaultSinkByName(modelData.name);
root.deviceSelected(modelData);