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

Surface color overhaul

This commit is contained in:
bbedward
2025-09-25 11:35:43 -04:00
parent 7ccd2d9418
commit 8e103d7ba7
51 changed files with 350 additions and 266 deletions

View File

@@ -130,7 +130,8 @@ Singleton {
property bool topBarGothCornersEnabled: false
property bool lockScreenShowPowerActions: true
property bool hideBrightnessSlider: false
property string widgetBackgroundColor: "sth"
property string widgetBackgroundColor: "sch"
property string surfaceBase: "sc"
property int notificationTimeoutLow: 5000
property int notificationTimeoutNormal: 5000
property int notificationTimeoutCritical: 0
@@ -323,7 +324,8 @@ 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"
widgetBackgroundColor = settings.widgetBackgroundColor !== undefined ? settings.widgetBackgroundColor : "sch"
surfaceBase = settings.surfaceBase !== undefined ? settings.surfaceBase : "sc"
screenPreferences = settings.screenPreferences !== undefined ? settings.screenPreferences : ({})
applyStoredTheme()
detectAvailableIconThemes()
@@ -433,6 +435,7 @@ Singleton {
"lockScreenShowPowerActions": lockScreenShowPowerActions,
"hideBrightnessSlider": hideBrightnessSlider,
"widgetBackgroundColor": widgetBackgroundColor,
"surfaceBase": surfaceBase,
"notificationTimeoutLow": notificationTimeoutLow,
"notificationTimeoutNormal": notificationTimeoutNormal,
"notificationTimeoutCritical": notificationTimeoutCritical,
@@ -1054,6 +1057,14 @@ Singleton {
saveSettings()
}
function setSurfaceBase(base) {
surfaceBase = base
saveSettings()
if (typeof Theme !== "undefined") {
Theme.generateSystemThemesFromCurrentTheme()
}
}
function setScreenPreferences(prefs) {
screenPreferences = prefs
saveSettings()

View File

@@ -10,7 +10,8 @@ const CatppuccinMocha = {
backgroundText: "#cdd6f4",
outline: "#6c7086",
surfaceContainer: "#313244",
surfaceContainerHigh: "#585b70"
surfaceContainerHigh: "#585b70",
surfaceContainerHighest: "#7f849c"
}
const CatppuccinLatte = {
@@ -22,7 +23,8 @@ const CatppuccinLatte = {
backgroundText: "#4c4f69",
outline: "#9ca0b0",
surfaceContainer: "#ccd0da",
surfaceContainerHigh: "#acb0be"
surfaceContainerHigh: "#acb0be",
surfaceContainerHighest: "#8c8fa1"
}
const CatppuccinVariants = {
@@ -127,7 +129,8 @@ const StockThemes = {
backgroundText: "#e3e8ef",
outline: "#8e918f",
surfaceContainer: "#1e2023",
surfaceContainerHigh: "#292b2f"
surfaceContainerHigh: "#292b2f",
surfaceContainerHighest: "#343740"
},
purple: {
name: "Purple",
@@ -144,7 +147,8 @@ const StockThemes = {
backgroundText: "#E6E0E9",
outline: "#938F99",
surfaceContainer: "#1D1B20",
surfaceContainerHigh: "#2B2930"
surfaceContainerHigh: "#2B2930",
surfaceContainerHighest: "#36343B"
},
green: {
name: "Green",
@@ -161,7 +165,8 @@ const StockThemes = {
backgroundText: "#e1f5e3",
outline: "#8b938c",
surfaceContainer: "#1a1f1b",
surfaceContainerHigh: "#252a26"
surfaceContainerHigh: "#252a26",
surfaceContainerHighest: "#30352f"
},
orange: {
name: "Orange",
@@ -178,7 +183,8 @@ const StockThemes = {
backgroundText: "#f5f1ea",
outline: "#958f84",
surfaceContainer: "#211e17",
surfaceContainerHigh: "#2c291f"
surfaceContainerHigh: "#2c291f",
surfaceContainerHighest: "#373427"
},
red: {
name: "Red",
@@ -195,7 +201,8 @@ const StockThemes = {
backgroundText: "#f5e8ea",
outline: "#958b8d",
surfaceContainer: "#211b1c",
surfaceContainerHigh: "#2c2426"
surfaceContainerHigh: "#2c2426",
surfaceContainerHighest: "#372f30"
},
cyan: {
name: "Cyan",
@@ -212,7 +219,8 @@ const StockThemes = {
backgroundText: "#e8f4f5",
outline: "#8c9194",
surfaceContainer: "#1a1f20",
surfaceContainerHigh: "#252b2c"
surfaceContainerHigh: "#252b2c",
surfaceContainerHighest: "#303637"
},
pink: {
name: "Pink",
@@ -229,7 +237,8 @@ const StockThemes = {
backgroundText: "#f3e8ee",
outline: "#938a90",
surfaceContainer: "#1f1b1e",
surfaceContainerHigh: "#2a2428"
surfaceContainerHigh: "#2a2428",
surfaceContainerHighest: "#352f32"
},
amber: {
name: "Amber",
@@ -246,7 +255,8 @@ const StockThemes = {
backgroundText: "#f3f0e8",
outline: "#949084",
surfaceContainer: "#1f1e17",
surfaceContainerHigh: "#2a281f"
surfaceContainerHigh: "#2a281f",
surfaceContainerHighest: "#353327"
},
coral: {
name: "Coral",
@@ -263,7 +273,8 @@ const StockThemes = {
backgroundText: "#f1e8e7",
outline: "#968b8a",
surfaceContainer: "#201a19",
surfaceContainerHigh: "#2b2221"
surfaceContainerHigh: "#2b2221",
surfaceContainerHighest: "#362d29"
},
monochrome: {
name: "Monochrome",
@@ -281,6 +292,7 @@ const StockThemes = {
outline: "#929092",
surfaceContainer: "#2a2a2a",
surfaceContainerHigh: "#2a2a2b",
surfaceContainerHighest: "#353535",
error: "#ffb4ab",
warning: "#3f4759",
info: "#595e6c",
@@ -303,7 +315,8 @@ const StockThemes = {
backgroundText: "#1a1c1e",
outline: "#79747e",
surfaceContainer: "#f3f3f3",
surfaceContainerHigh: "#ececec"
surfaceContainerHigh: "#ececec",
surfaceContainerHighest: "#e6e6e6"
},
purple: {
name: "Purple Light",
@@ -320,7 +333,8 @@ const StockThemes = {
backgroundText: "#1C1B1F",
outline: "#79747E",
surfaceContainer: "#F3EDF7",
surfaceContainerHigh: "#ECE6F0"
surfaceContainerHigh: "#ECE6F0",
surfaceContainerHighest: "#E6DFE9"
},
green: {
name: "Green Light",
@@ -337,7 +351,8 @@ const StockThemes = {
backgroundText: "#1a1c1e",
outline: "#79747e",
surfaceContainer: "#f3f3f3",
surfaceContainerHigh: "#ececec"
surfaceContainerHigh: "#ececec",
surfaceContainerHighest: "#e6e6e6"
},
orange: {
name: "Orange Light",
@@ -354,7 +369,8 @@ const StockThemes = {
backgroundText: "#1a1c1e",
outline: "#79747e",
surfaceContainer: "#f3f3f3",
surfaceContainerHigh: "#ececec"
surfaceContainerHigh: "#ececec",
surfaceContainerHighest: "#e6e6e6"
},
red: {
name: "Red Light",
@@ -371,7 +387,8 @@ const StockThemes = {
backgroundText: "#1a1c1e",
outline: "#79747e",
surfaceContainer: "#f3f3f3",
surfaceContainerHigh: "#ececec"
surfaceContainerHigh: "#ececec",
surfaceContainerHighest: "#e6e6e6"
},
cyan: {
name: "Cyan Light",
@@ -388,7 +405,8 @@ const StockThemes = {
backgroundText: "#1a1c1e",
outline: "#79747e",
surfaceContainer: "#f3f3f3",
surfaceContainerHigh: "#ececec"
surfaceContainerHigh: "#ececec",
surfaceContainerHighest: "#e6e6e6"
},
pink: {
name: "Pink Light",
@@ -405,7 +423,8 @@ const StockThemes = {
backgroundText: "#1a1c1e",
outline: "#79747e",
surfaceContainer: "#f3f3f3",
surfaceContainerHigh: "#ececec"
surfaceContainerHigh: "#ececec",
surfaceContainerHighest: "#e6e6e6"
},
amber: {
name: "Amber Light",
@@ -422,7 +441,8 @@ const StockThemes = {
backgroundText: "#1a1c1e",
outline: "#79747e",
surfaceContainer: "#f3f3f3",
surfaceContainerHigh: "#ececec"
surfaceContainerHigh: "#ececec",
surfaceContainerHighest: "#e6e6e6"
},
coral: {
name: "Coral Light",
@@ -439,7 +459,8 @@ const StockThemes = {
backgroundText: "#1a1c1e",
outline: "#79747e",
surfaceContainer: "#f3f3f3",
surfaceContainerHigh: "#ececec"
surfaceContainerHigh: "#ececec",
surfaceContainerHighest: "#e6e6e6"
},
monochrome: {
name: "Monochrome Light",

View File

@@ -120,6 +120,7 @@ Singleton {
"outline": getMatugenColor("outline", "#8e918f"),
"surfaceContainer": getMatugenColor("surface_container", "#1e2023"),
"surfaceContainerHigh": getMatugenColor("surface_container_high", "#292b2f"),
"surfaceContainerHighest": getMatugenColor("surface_container_highest", "#343740"),
"error": "#F2B8B5",
"warning": "#FF9800",
"info": "#2196F3",
@@ -154,7 +155,12 @@ Singleton {
property color primaryText: currentThemeData.primaryText
property color primaryContainer: currentThemeData.primaryContainer
property color secondary: currentThemeData.secondary
property color surface: currentThemeData.surface
property color surface: {
if (typeof SettingsData !== "undefined" && SettingsData.surfaceBase === "s") {
return currentThemeData.background
}
return currentThemeData.surface
}
property color surfaceText: currentThemeData.surfaceText
property color surfaceVariant: currentThemeData.surfaceVariant
property color surfaceVariantText: currentThemeData.surfaceVariantText
@@ -163,8 +169,24 @@ Singleton {
property color backgroundText: currentThemeData.backgroundText
property color outline: currentThemeData.outline
property color outlineVariant: currentThemeData.outlineVariant || Qt.rgba(outline.r, outline.g, outline.b, 0.6)
property color surfaceContainer: currentThemeData.surfaceContainer
property color surfaceContainerHigh: currentThemeData.surfaceContainerHigh
property color surfaceContainer: {
if (typeof SettingsData !== "undefined" && SettingsData.surfaceBase === "s") {
return currentThemeData.surface
}
return currentThemeData.surfaceContainer
}
property color surfaceContainerHigh: {
if (typeof SettingsData !== "undefined" && SettingsData.surfaceBase === "s") {
return currentThemeData.surfaceContainer
}
return currentThemeData.surfaceContainerHigh
}
property color surfaceContainerHighest: {
if (typeof SettingsData !== "undefined" && SettingsData.surfaceBase === "s") {
return currentThemeData.surfaceContainerHigh
}
return currentThemeData.surfaceContainerHighest
}
property color onSurface: surfaceText
property color onSurfaceVariant: surfaceVariantText
@@ -367,7 +389,7 @@ Singleton {
property real notepadTransparency: SettingsData.notepadTransparencyOverride >= 0 ? SettingsData.notepadTransparencyOverride : popupTransparency
property var widgetBaseBackgroundColor: {
const colorMode = typeof SettingsData !== "undefined" ? SettingsData.widgetBackgroundColor : "sth"
const colorMode = typeof SettingsData !== "undefined" ? SettingsData.widgetBackgroundColor : "sch"
switch (colorMode) {
case "s":
return surface
@@ -388,7 +410,7 @@ Singleton {
}
property var widgetBackground: {
const colorMode = typeof SettingsData !== "undefined" ? SettingsData.widgetBackgroundColor : "sth"
const colorMode = typeof SettingsData !== "undefined" ? SettingsData.widgetBackgroundColor : "sch"
switch (colorMode) {
case "s":
return Qt.rgba(surface.r, surface.g, surface.b, widgetTransparency)
@@ -541,7 +563,8 @@ Singleton {
"value": value,
"mode": isLight ? "light" : "dark",
"iconTheme": iconTheme || "System Default",
"matugenType": matugenType || "scheme-tonal-spot"
"matugenType": matugenType || "scheme-tonal-spot",
"surfaceBase": (typeof SettingsData !== "undefined" && SettingsData.surfaceBase) ? SettingsData.surfaceBase : "sc"
}
const json = JSON.stringify(desired)