1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-24 13:32:50 -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)
updateQtIconTheme(themeName)
saveSettings()
if (typeof Theme !== "undefined" && Theme.isDynamicTheme)
if (typeof Theme !== "undefined" && Theme.currentTheme === Theme.dynamic)
Theme.generateSystemThemes()
}

View File

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

View File

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

View File

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