1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-24 21:42:51 -05:00

Multiple widget color opts

This commit is contained in:
bbedward
2025-09-21 09:24:55 -04:00
parent 72b79c0f51
commit 12e8e72bb2
29 changed files with 133 additions and 187 deletions

View File

@@ -119,6 +119,7 @@ Singleton {
property bool topBarGothCornersEnabled: false
property bool lockScreenShowPowerActions: true
property bool hideBrightnessSlider: false
property string widgetBackgroundColor: "sth"
property int notificationTimeoutLow: 5000
property int notificationTimeoutNormal: 5000
property int notificationTimeoutCritical: 0
@@ -299,6 +300,7 @@ Singleton {
topBarGothCornersEnabled = settings.topBarGothCornersEnabled !== undefined ? settings.topBarGothCornersEnabled : false
lockScreenShowPowerActions = settings.lockScreenShowPowerActions !== undefined ? settings.lockScreenShowPowerActions : true
hideBrightnessSlider = settings.hideBrightnessSlider !== undefined ? settings.hideBrightnessSlider : false
widgetBackgroundColor = settings.widgetBackgroundColor !== undefined ? settings.widgetBackgroundColor : "sth"
screenPreferences = settings.screenPreferences !== undefined ? settings.screenPreferences : ({})
applyStoredTheme()
detectAvailableIconThemes()
@@ -405,6 +407,7 @@ Singleton {
"topBarGothCornersEnabled": topBarGothCornersEnabled,
"lockScreenShowPowerActions": lockScreenShowPowerActions,
"hideBrightnessSlider": hideBrightnessSlider,
"widgetBackgroundColor": widgetBackgroundColor,
"notificationTimeoutLow": notificationTimeoutLow,
"notificationTimeoutNormal": notificationTimeoutNormal,
"notificationTimeoutCritical": notificationTimeoutCritical,
@@ -998,6 +1001,11 @@ Singleton {
saveSettings()
}
function setWidgetBackgroundColor(color) {
widgetBackgroundColor = color
saveSettings()
}
function setScreenPreferences(prefs) {
screenPreferences = prefs
saveSettings()

View File

@@ -337,8 +337,40 @@ Singleton {
property real notepadTransparency: SettingsData.notepadTransparencyOverride >= 0 ? SettingsData.notepadTransparencyOverride : popupTransparency
function widgetBackground() {
return Qt.rgba(surfaceContainer.r, surfaceContainer.g, surfaceContainer.b, widgetTransparency)
property var widgetBaseBackgroundColor: {
const colorMode = typeof SettingsData !== "undefined" ? SettingsData.widgetBackgroundColor : "sth"
switch (colorMode) {
case "s":
return surface
case "sc":
return surfaceContainer
case "sch":
return surfaceContainerHigh
case "sth":
default:
return surfaceTextHover
}
}
property var widgetBaseHoverColor: {
const baseColor = widgetBaseBackgroundColor
const factor = 1.2
return isLightMode ? Qt.darker(baseColor, factor) : Qt.lighter(baseColor, factor)
}
property var widgetBackground: {
const colorMode = typeof SettingsData !== "undefined" ? SettingsData.widgetBackgroundColor : "sth"
switch (colorMode) {
case "s":
return Qt.rgba(surface.r, surface.g, surface.b, widgetTransparency)
case "sc":
return Qt.rgba(surfaceContainer.r, surfaceContainer.g, surfaceContainer.b, widgetTransparency)
case "sch":
return Qt.rgba(surfaceContainerHigh.r, surfaceContainerHigh.g, surfaceContainerHigh.b, widgetTransparency)
case "sth":
default:
return Qt.rgba(surfaceContainer.r, surfaceContainer.g, surfaceContainer.b, widgetTransparency)
}
}
function getPopupBackgroundAlpha() {