mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-24 21:42:51 -05:00
themes: incorporate theme registry, browser, dms URI scheme handling
This commit is contained in:
@@ -63,6 +63,7 @@ Singleton {
|
||||
property alias dankBarRightWidgetsModel: rightWidgetsModel
|
||||
|
||||
property string currentThemeName: "blue"
|
||||
property string currentThemeCategory: "generic"
|
||||
property string customThemeFile: ""
|
||||
property string matugenScheme: "scheme-tonal-spot"
|
||||
property bool runUserMatugenTemplates: true
|
||||
@@ -562,10 +563,12 @@ Singleton {
|
||||
|
||||
function applyStoredTheme() {
|
||||
if (typeof Theme !== "undefined") {
|
||||
Theme.currentThemeCategory = currentThemeCategory;
|
||||
Theme.switchTheme(currentThemeName, false, false);
|
||||
} else {
|
||||
Qt.callLater(function () {
|
||||
if (typeof Theme !== "undefined") {
|
||||
Theme.currentThemeCategory = currentThemeCategory;
|
||||
Theme.switchTheme(currentThemeName, false, false);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -474,24 +474,32 @@ Singleton {
|
||||
|
||||
if (themeName === dynamic) {
|
||||
currentTheme = dynamic;
|
||||
currentThemeCategory = dynamic;
|
||||
if (currentThemeCategory !== "registry")
|
||||
currentThemeCategory = dynamic;
|
||||
} else if (themeName === custom) {
|
||||
currentTheme = custom;
|
||||
currentThemeCategory = custom;
|
||||
if (currentThemeCategory !== "registry")
|
||||
currentThemeCategory = custom;
|
||||
if (typeof SettingsData !== "undefined" && SettingsData.customThemeFile) {
|
||||
loadCustomThemeFromFile(SettingsData.customThemeFile);
|
||||
}
|
||||
} else if (themeName === "" && currentThemeCategory === "registry") {
|
||||
// Registry category selected but no theme chosen yet
|
||||
} else {
|
||||
currentTheme = themeName;
|
||||
if (StockThemes.isCatppuccinVariant(themeName)) {
|
||||
currentThemeCategory = "catppuccin";
|
||||
} else {
|
||||
currentThemeCategory = "generic";
|
||||
if (currentThemeCategory !== "registry") {
|
||||
if (StockThemes.isCatppuccinVariant(themeName)) {
|
||||
currentThemeCategory = "catppuccin";
|
||||
} else {
|
||||
currentThemeCategory = "generic";
|
||||
}
|
||||
}
|
||||
}
|
||||
const isGreeterMode = (typeof SessionData !== "undefined" && SessionData.isGreeterMode);
|
||||
if (savePrefs && typeof SettingsData !== "undefined" && !isGreeterMode)
|
||||
if (savePrefs && typeof SettingsData !== "undefined" && !isGreeterMode) {
|
||||
SettingsData.set("currentThemeCategory", currentThemeCategory);
|
||||
SettingsData.set("currentThemeName", currentTheme);
|
||||
}
|
||||
|
||||
if (!isGreeterMode) {
|
||||
generateSystemThemesFromCurrentTheme();
|
||||
|
||||
@@ -7,6 +7,7 @@ function percentToUnit(v) {
|
||||
|
||||
var SPEC = {
|
||||
currentThemeName: { def: "blue", onChange: "applyStoredTheme" },
|
||||
currentThemeCategory: { def: "generic" },
|
||||
customThemeFile: { def: "" },
|
||||
matugenScheme: { def: "scheme-tonal-spot", onChange: "regenSystemThemes" },
|
||||
runUserMatugenTemplates: { def: true, onChange: "regenSystemThemes" },
|
||||
|
||||
Reference in New Issue
Block a user