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

Fix non-dynamic themes not persisting

This commit is contained in:
bbedward
2025-08-20 23:02:55 -04:00
parent aedf78453e
commit 7c95d8df3b
4 changed files with 11 additions and 12 deletions

View File

@@ -732,7 +732,7 @@ Singleton {
updateGtkIconTheme(themeName) updateGtkIconTheme(themeName)
updateQtIconTheme(themeName) updateQtIconTheme(themeName)
saveSettings() saveSettings()
if (typeof Theme !== "undefined" && Theme.isDynamicTheme) if (typeof Theme !== "undefined" && Theme.currentTheme === Theme.dynamic)
Theme.generateSystemThemes() Theme.generateSystemThemes()
} }

View File

@@ -16,7 +16,6 @@ Singleton {
property bool isLightMode: false property bool isLightMode: false
readonly property string dynamic: "dynamic" readonly property string dynamic: "dynamic"
readonly property bool isDynamicTheme: !StockThemes.isStockTheme(currentTheme)
readonly property string homeDir: { readonly property string homeDir: {
const url = StandardPaths.writableLocation(StandardPaths.HomeLocation).toString() const url = StandardPaths.writableLocation(StandardPaths.HomeLocation).toString()
@@ -328,7 +327,7 @@ Singleton {
function onLightModeChanged() { function onLightModeChanged() {
if (matugenColors && Object.keys(matugenColors).length > 0) { if (matugenColors && Object.keys(matugenColors).length > 0) {
colorUpdateTrigger++ colorUpdateTrigger++
if (isDynamicTheme) { if (currentTheme === dynamic) {
generateSystemThemes() generateSystemThemes()
} }
} }
@@ -353,7 +352,7 @@ Singleton {
} }
function generateSystemThemesFromCurrentTheme() { function generateSystemThemesFromCurrentTheme() {
if (!isDynamicTheme) if (currentTheme !== dynamic)
return return
if (systemThemeGenerationInProgress) if (systemThemeGenerationInProgress)

View File

@@ -621,7 +621,7 @@ Item {
id: toggle id: toggle
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
checked: Theme.isDynamicTheme checked: Theme.currentTheme === Theme.dynamic
enabled: ToastService.wallpaperErrorStatus !== "matugen_missing" enabled: ToastService.wallpaperErrorStatus !== "matugen_missing"
onToggled: toggled => { onToggled: toggled => {
if (toggled) if (toggled)

View File

@@ -140,7 +140,7 @@ Item {
spacing: Theme.spacingS spacing: Theme.spacingS
StyledText { StyledText {
text: "Current Theme: " + (Theme.isDynamicTheme ? "Dynamic" : Theme.getThemeColors(Theme.currentThemeName).name) text: "Current Theme: " + (Theme.currentTheme === Theme.dynamic ? "Dynamic" : Theme.getThemeColors(Theme.currentThemeName).name)
font.pixelSize: Theme.fontSizeMedium font.pixelSize: Theme.fontSizeMedium
color: Theme.surfaceText color: Theme.surfaceText
font.weight: Font.Medium font.weight: Font.Medium
@@ -149,7 +149,7 @@ Item {
StyledText { StyledText {
text: { text: {
if (Theme.isDynamicTheme) if (Theme.currentTheme === Theme.dynamic)
return "Wallpaper-based dynamic colors" return "Wallpaper-based dynamic colors"
var descriptions = { var descriptions = {
@@ -193,9 +193,9 @@ Item {
color: Theme.getThemeColors(themeName).primary color: Theme.getThemeColors(themeName).primary
border.color: Theme.outline border.color: Theme.outline
border.width: (Theme.currentThemeName === themeName border.width: (Theme.currentThemeName === themeName
&& !Theme.isDynamicTheme) ? 2 : 1 && Theme.currentTheme !== Theme.dynamic) ? 2 : 1
scale: (Theme.currentThemeName === themeName scale: (Theme.currentThemeName === themeName
&& !Theme.isDynamicTheme) ? 1.1 : 1 && Theme.currentTheme !== Theme.dynamic) ? 1.1 : 1
Rectangle { Rectangle {
width: nameText.contentWidth + Theme.spacingS * 2 width: nameText.contentWidth + Theme.spacingS * 2
@@ -226,7 +226,7 @@ Item {
hoverEnabled: true hoverEnabled: true
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
onClicked: { onClicked: {
Theme.switchTheme(themeName, false) Theme.switchTheme(themeName)
} }
} }
@@ -431,7 +431,7 @@ Item {
anchors.bottomMargin: Theme.spacingS anchors.bottomMargin: Theme.spacingS
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
visible: autoMouseArea.containsMouse visible: autoMouseArea.containsMouse
&& (!Theme.isDynamicTheme && (Theme.currentTheme !== Theme.dynamic
|| ToastService.wallpaperErrorStatus === "error" || ToastService.wallpaperErrorStatus === "error"
|| ToastService.wallpaperErrorStatus || ToastService.wallpaperErrorStatus
=== "matugen_missing") === "matugen_missing")
@@ -788,7 +788,7 @@ Item {
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
Theme.outline.b, 0.2) Theme.outline.b, 0.2)
border.width: 1 border.width: 1
visible: Theme.isDynamicTheme && Theme.matugenAvailable visible: Theme.currentTheme === Theme.dynamic && Theme.matugenAvailable
Column { Column {
id: systemThemingSection id: systemThemingSection