1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-26 06:22:50 -05:00

brightness: fix ddc erasing devices, fix OSD behaviors

This commit is contained in:
bbedward
2025-12-01 16:32:10 -05:00
parent 1d91d8fd94
commit bd99be15c2
10 changed files with 127 additions and 111 deletions

View File

@@ -1,7 +1,4 @@
import QtQuick
import QtQuick.Controls
import Quickshell
import Quickshell.Services.Pipewire
import qs.Common
import qs.Services
import qs.Widgets
@@ -30,9 +27,8 @@ Row {
cursorShape: Qt.PointingHandCursor
onClicked: {
if (defaultSource) {
AudioService.suppressOSD = true
defaultSource.audio.muted = !defaultSource.audio.muted
AudioService.suppressOSD = false
SessionData.suppressOSDTemporarily();
defaultSource.audio.muted = !defaultSource.audio.muted;
}
}
}
@@ -40,13 +36,15 @@ Row {
DankIcon {
anchors.centerIn: parent
name: {
if (!defaultSource) return "mic_off"
if (!defaultSource)
return "mic_off";
let volume = defaultSource.audio.volume
let muted = defaultSource.audio.muted
let volume = defaultSource.audio.volume;
let muted = defaultSource.audio.muted;
if (muted || volume === 0.0) return "mic_off"
return "mic"
if (muted || volume === 0.0)
return "mic_off";
return "mic";
}
size: Theme.iconSize
color: defaultSource && !defaultSource.audio.muted && defaultSource.audio.volume > 0 ? Theme.primary : Theme.surfaceText
@@ -67,16 +65,14 @@ Row {
valueOverride: actualVolumePercent
thumbOutlineColor: Theme.surfaceContainer
trackColor: root.sliderTrackColor.a > 0 ? root.sliderTrackColor : Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
onIsDraggingChanged: {
AudioService.suppressOSD = isDragging
}
onSliderValueChanged: function(newValue) {
onSliderValueChanged: function (newValue) {
if (defaultSource) {
defaultSource.audio.volume = newValue / 100.0
SessionData.suppressOSDTemporarily();
defaultSource.audio.volume = newValue / 100.0;
if (newValue > 0 && defaultSource.audio.muted) {
defaultSource.audio.muted = false
defaultSource.audio.muted = false;
}
}
}
}
}
}