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

themes: fix terminals always dark with custom themes

This commit is contained in:
bbedward
2025-12-23 22:33:33 -05:00
parent 45d34dcb5b
commit 6c56d23b93

View File

@@ -92,6 +92,7 @@ Singleton {
property var matugenColors: ({}) property var matugenColors: ({})
property var _pendingGenerateParams: null property var _pendingGenerateParams: null
property var customThemeData: null property var customThemeData: null
property var customThemeRawData: null
Component.onCompleted: { Component.onCompleted: {
Quickshell.execDetached(["mkdir", "-p", stateDir]); Quickshell.execDetached(["mkdir", "-p", stateDir]);
@@ -602,6 +603,7 @@ Singleton {
} }
function loadCustomTheme(themeData) { function loadCustomTheme(themeData) {
customThemeRawData = themeData;
if (themeData.dark || themeData.light) { if (themeData.dark || themeData.light) {
const colorMode = (typeof SessionData !== "undefined" && SessionData.isLightMode) ? "light" : "dark"; const colorMode = (typeof SessionData !== "undefined" && SessionData.isLightMode) ? "light" : "dark";
const selectedTheme = themeData[colorMode] || themeData.dark || themeData.light; const selectedTheme = themeData[colorMode] || themeData.dark || themeData.light;
@@ -907,8 +909,13 @@ Singleton {
let darkTheme, lightTheme; let darkTheme, lightTheme;
if (currentTheme === "custom") { if (currentTheme === "custom") {
darkTheme = customThemeData; if (customThemeRawData && (customThemeRawData.dark || customThemeRawData.light)) {
lightTheme = customThemeData; darkTheme = customThemeRawData.dark || customThemeRawData.light;
lightTheme = customThemeRawData.light || customThemeRawData.dark;
} else {
darkTheme = customThemeData;
lightTheme = customThemeData;
}
} else { } else {
darkTheme = StockThemes.getThemeByName(currentTheme, false); darkTheme = StockThemes.getThemeByName(currentTheme, false);
lightTheme = StockThemes.getThemeByName(currentTheme, true); lightTheme = StockThemes.getThemeByName(currentTheme, true);