1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2025-12-06 05:25:41 -05:00

feat: Display persistent OSD percentage option

This commit is contained in:
purian23
2025-10-04 22:02:25 -04:00
parent df2469468b
commit ad44f09421
6 changed files with 31 additions and 4 deletions

View File

@@ -69,9 +69,6 @@ Row {
valueOverride: actualVolumePercent
thumbOutlineColor: Theme.surfaceContainer
trackColor: root.sliderTrackColor.a > 0 ? root.sliderTrackColor : Theme.surfaceContainerHigh
onIsDraggingChanged: {
AudioService.suppressOSD = isDragging
}
onSliderValueChanged: function(newValue) {
if (defaultSink) {
defaultSink.audio.volume = newValue / 100.0

View File

@@ -79,6 +79,7 @@ DankOSD {
showValue: true
unit: "%"
thumbOutlineColor: Theme.surfaceContainer
alwaysShowValue: SettingsData.osdAlwaysShowValue
Component.onCompleted: {
if (DisplayService.brightnessAvailable) {

View File

@@ -94,6 +94,7 @@ DankOSD {
unit: "%"
thumbOutlineColor: Theme.surfaceContainer
valueOverride: displayPercent
alwaysShowValue: SettingsData.osdAlwaysShowValue
Component.onCompleted: {
if (AudioService.sink && AudioService.sink.audio) {
@@ -103,7 +104,9 @@ DankOSD {
onSliderValueChanged: newValue => {
if (AudioService.sink && AudioService.sink.audio) {
AudioService.suppressOSD = true
AudioService.sink.audio.volume = newValue / 100
AudioService.suppressOSD = false
}
}

View File

@@ -1458,6 +1458,23 @@ Item {
SettingsData.sendTestNotifications()
}
}
Rectangle {
width: parent.width
height: 1
color: Theme.outline
opacity: 0.2
}
DankToggle {
width: parent.width
text: "Always Show OSD Percentage"
description: "Display volume and brightness percentage values by default in OSD popups"
checked: SettingsData.osdAlwaysShowValue
onToggled: checked => {
SettingsData.setOsdAlwaysShowValue(checked)
}
}
}
}