mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-10-18 09:14:01 -04:00
theme: add widgetInactiveIconColor token, apply to volume 0
This commit is contained in:
@@ -1464,6 +1464,8 @@ Singleton {
|
||||
}
|
||||
}
|
||||
|
||||
property color widgetInactiveIconColor: withAlpha(widgetIconColor, 0.6)
|
||||
|
||||
property color widgetTextColor: {
|
||||
if (typeof SettingsData === "undefined") {
|
||||
return surfaceText;
|
||||
|
||||
@@ -164,6 +164,12 @@ BasePill {
|
||||
return Theme.widgetIconColor;
|
||||
}
|
||||
|
||||
function getAudioIconColor() {
|
||||
if (AudioService.sinkSilent)
|
||||
return Theme.widgetInactiveIconColor;
|
||||
return Theme.widgetIconColor;
|
||||
}
|
||||
|
||||
function getBrightnessIconName() {
|
||||
const deviceName = getEffectiveBrightnessDevice();
|
||||
return DisplayService.brightnessIconName(DisplayService.getCurrentDeviceInfoByName(deviceName), DisplayService.getDeviceBrightness(deviceName));
|
||||
@@ -545,7 +551,7 @@ BasePill {
|
||||
visible: verticalGroupItem.modelData.id === "audio"
|
||||
name: AudioService.sinkVolumeIconName
|
||||
size: root.vIconSize
|
||||
color: Theme.widgetIconColor
|
||||
color: root.getAudioIconColor()
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.top: parent.top
|
||||
}
|
||||
@@ -745,7 +751,7 @@ BasePill {
|
||||
id: audioIcon
|
||||
name: AudioService.sinkVolumeIconName
|
||||
size: root.getControlCenterIconSize()
|
||||
color: Theme.widgetIconColor
|
||||
color: root.getAudioIconColor()
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
|
||||
@@ -1575,21 +1575,9 @@ Item {
|
||||
}
|
||||
|
||||
DankIcon {
|
||||
name: {
|
||||
if (!AudioService.sink?.audio) {
|
||||
return "volume_up";
|
||||
}
|
||||
if (AudioService.sink.audio.muted)
|
||||
return "volume_off";
|
||||
if (AudioService.sink.audio.volume === 0)
|
||||
return "volume_mute";
|
||||
if (AudioService.sink.audio.volume * 100 < 33) {
|
||||
return "volume_down";
|
||||
}
|
||||
return "volume_up";
|
||||
}
|
||||
name: AudioService.sinkVolumeIconName
|
||||
size: Theme.iconSize - 2
|
||||
color: (AudioService.sink && AudioService.sink.audio && (AudioService.sink.audio.muted || AudioService.sink.audio.volume === 0)) ? Qt.rgba(255, 255, 255, 0.5) : "white"
|
||||
color: AudioService.sinkSilent ? Qt.rgba(255, 255, 255, 0.5) : "white"
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
visible: AudioService.sink && AudioService.sink.audio
|
||||
}
|
||||
|
||||
@@ -1866,7 +1866,7 @@ Item {
|
||||
DankIcon {
|
||||
name: AudioService.sinkVolumeIconName
|
||||
size: Theme.iconSize - 2
|
||||
color: (AudioService.sink && AudioService.sink.audio && (AudioService.sink.audio.muted || AudioService.sink.audio.volume === 0)) ? Qt.rgba(255, 255, 255, 0.5) : "white"
|
||||
color: AudioService.sinkSilent ? Qt.rgba(255, 255, 255, 0.5) : "white"
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
visible: AudioService.sink && AudioService.sink.audio
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ DankOSD {
|
||||
|
||||
OsdLevelRow {
|
||||
anchors.fill: parent
|
||||
iconName: AudioService.sink?.audio?.muted ? "volume_off" : "volume_up"
|
||||
iconName: AudioService.sinkVolumeIconName
|
||||
iconInteractive: true
|
||||
value: root._displayVolume
|
||||
minimum: 0
|
||||
@@ -108,7 +108,7 @@ DankOSD {
|
||||
|
||||
DankIcon {
|
||||
anchors.centerIn: parent
|
||||
name: AudioService.sink?.audio?.muted ? "volume_off" : "volume_up"
|
||||
name: AudioService.sinkVolumeIconName
|
||||
size: Theme.iconSize
|
||||
color: muteButtonVert.containsMouse ? Theme.primary : Theme.surfaceText
|
||||
}
|
||||
|
||||
@@ -796,6 +796,14 @@ EOFCONFIG
|
||||
}
|
||||
|
||||
readonly property string sinkVolumeIconName: volumeIconName(sink)
|
||||
readonly property bool sinkSilent: isSilent(sink)
|
||||
|
||||
function isSilent(node) {
|
||||
const audio = node?.audio;
|
||||
if (!audio)
|
||||
return false;
|
||||
return audio.muted || audio.volume === 0;
|
||||
}
|
||||
|
||||
function volumeIconName(node, noDeviceIcon = "volume_off") {
|
||||
const audio = node?.audio;
|
||||
|
||||
Reference in New Issue
Block a user