1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2025-12-07 22:15:38 -05:00

osd: add option to disable each OSD

This commit is contained in:
bbedward
2025-11-15 11:36:33 -05:00
parent 1c264d858b
commit cbb244f785
9 changed files with 122 additions and 8 deletions

View File

@@ -305,6 +305,12 @@ Singleton {
property int notificationPopupPosition: SettingsData.Position.Top
property bool osdAlwaysShowValue: false
property bool osdVolumeEnabled: true
property bool osdBrightnessEnabled: true
property bool osdIdleInhibitorEnabled: true
property bool osdMicMuteEnabled: true
property bool osdCapsLockEnabled: true
property bool osdPowerProfileEnabled: true
property bool powerActionConfirm: true
property var powerMenuActions: ["reboot", "logout", "poweroff", "lock", "suspend", "restart"]

View File

@@ -215,6 +215,12 @@ var SPEC = {
notificationPopupPosition: { def: 0 },
osdAlwaysShowValue: { def: false },
osdVolumeEnabled: { def: true },
osdBrightnessEnabled: { def: true },
osdIdleInhibitorEnabled: { def: true },
osdMicMuteEnabled: { def: true },
osdCapsLockEnabled: { def: true },
osdPowerProfileEnabled: { def: true },
powerActionConfirm: { def: true },
powerMenuActions: { def: ["reboot", "logout", "poweroff", "lock", "suspend", "restart"] },

View File

@@ -14,7 +14,7 @@ DankOSD {
Connections {
target: DisplayService
function onBrightnessChanged(showOsd) {
if (showOsd) {
if (showOsd && SettingsData.osdBrightnessEnabled) {
root.show()
}
}

View File

@@ -17,7 +17,7 @@ DankOSD {
target: DMSService
function onCapsLockStateChanged() {
if (lastCapsLockState !== DMSService.capsLockState) {
if (lastCapsLockState !== DMSService.capsLockState && SettingsData.osdCapsLockEnabled) {
root.show()
}
lastCapsLockState = DMSService.capsLockState

View File

@@ -14,7 +14,9 @@ DankOSD {
Connections {
target: SessionService
function onInhibitorChanged() {
root.show()
if (SettingsData.osdIdleInhibitorEnabled) {
root.show()
}
}
}

View File

@@ -14,7 +14,9 @@ DankOSD {
Connections {
target: AudioService
function onMicMuteChanged() {
root.show()
if (SettingsData.osdMicMuteEnabled) {
root.show()
}
}
}

View File

@@ -18,7 +18,7 @@ DankOSD {
target: typeof PowerProfiles !== "undefined" ? PowerProfiles : null
function onProfileChanged() {
if (lastProfile !== -1 && lastProfile !== PowerProfiles.profile) {
if (lastProfile !== -1 && lastProfile !== PowerProfiles.profile && SettingsData.osdPowerProfileEnabled) {
root.show()
}
lastProfile = PowerProfiles.profile

View File

@@ -15,13 +15,13 @@ DankOSD {
target: AudioService.sink && AudioService.sink.audio ? AudioService.sink.audio : null
function onVolumeChanged() {
if (!AudioService.suppressOSD) {
if (!AudioService.suppressOSD && SettingsData.osdVolumeEnabled) {
root.show()
}
}
function onMutedChanged() {
if (!AudioService.suppressOSD) {
if (!AudioService.suppressOSD && SettingsData.osdVolumeEnabled) {
root.show()
}
}
@@ -31,7 +31,7 @@ DankOSD {
target: AudioService
function onSinkChanged() {
if (root.shouldBeVisible) {
if (root.shouldBeVisible && SettingsData.osdVolumeEnabled) {
root.show()
}
}

View File

@@ -700,6 +700,104 @@ Item {
}
}
}
StyledRect {
width: parent.width
height: osdSection.implicitHeight + Theme.spacingL * 2
radius: Theme.cornerRadius
color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
Theme.outline.b, 0.2)
border.width: 0
Column {
id: osdSection
anchors.fill: parent
anchors.margins: Theme.spacingL
spacing: Theme.spacingM
Row {
width: parent.width
spacing: Theme.spacingM
DankIcon {
name: "notification_important"
size: Theme.iconSize
color: Theme.primary
anchors.verticalCenter: parent.verticalCenter
}
StyledText {
text: I18n.tr("On-screen Displays")
font.pixelSize: Theme.fontSizeLarge
font.weight: Font.Medium
color: Theme.surfaceText
anchors.verticalCenter: parent.verticalCenter
}
}
DankToggle {
width: parent.width
text: I18n.tr("Volume OSD")
description: I18n.tr("Show on-screen display when volume changes")
checked: SettingsData.osdVolumeEnabled
onToggled: checked => {
return SettingsData.set("osdVolumeEnabled", checked)
}
}
DankToggle {
width: parent.width
text: I18n.tr("Brightness OSD")
description: I18n.tr("Show on-screen display when brightness changes")
checked: SettingsData.osdBrightnessEnabled
onToggled: checked => {
return SettingsData.set("osdBrightnessEnabled", checked)
}
}
DankToggle {
width: parent.width
text: I18n.tr("Idle Inhibitor OSD")
description: I18n.tr("Show on-screen display when idle inhibitor state changes")
checked: SettingsData.osdIdleInhibitorEnabled
onToggled: checked => {
return SettingsData.set("osdIdleInhibitorEnabled", checked)
}
}
DankToggle {
width: parent.width
text: I18n.tr("Microphone Mute OSD")
description: I18n.tr("Show on-screen display when microphone is muted/unmuted")
checked: SettingsData.osdMicMuteEnabled
onToggled: checked => {
return SettingsData.set("osdMicMuteEnabled", checked)
}
}
DankToggle {
width: parent.width
text: I18n.tr("Caps Lock OSD")
description: I18n.tr("Show on-screen display when caps lock state changes")
checked: SettingsData.osdCapsLockEnabled
onToggled: checked => {
return SettingsData.set("osdCapsLockEnabled", checked)
}
}
DankToggle {
width: parent.width
text: I18n.tr("Power Profile OSD")
description: I18n.tr("Show on-screen display when power profile changes")
checked: SettingsData.osdPowerProfileEnabled
onToggled: checked => {
return SettingsData.set("osdPowerProfileEnabled", checked)
}
}
}
}
}
}
}