mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-04-03 20:32:07 -04:00
@@ -130,6 +130,7 @@ Singleton {
|
||||
property string customThemeFile: ""
|
||||
property var registryThemeVariants: ({})
|
||||
property string matugenScheme: "scheme-tonal-spot"
|
||||
property real matugenContrast: 0
|
||||
property bool runUserMatugenTemplates: true
|
||||
property string matugenTargetMonitor: ""
|
||||
property real popupTransparency: 1.0
|
||||
@@ -484,9 +485,15 @@ Singleton {
|
||||
property bool matugenTemplateZed: true
|
||||
|
||||
property var matugenTemplateNeovimSettings: ({
|
||||
"dark": { "baseTheme": "github_dark", "harmony": 0.5 },
|
||||
"light": { "baseTheme": "github_light", "harmony": 0.5 }
|
||||
})
|
||||
"dark": {
|
||||
"baseTheme": "github_dark",
|
||||
"harmony": 0.5
|
||||
},
|
||||
"light": {
|
||||
"baseTheme": "github_light",
|
||||
"harmony": 0.5
|
||||
}
|
||||
})
|
||||
|
||||
property bool showDock: false
|
||||
property bool dockAutoHide: false
|
||||
@@ -1320,9 +1327,7 @@ Singleton {
|
||||
return true;
|
||||
|
||||
const msg = String(error || "").toLowerCase();
|
||||
return msg.indexOf("file does not exist") !== -1
|
||||
|| msg.indexOf("no such file") !== -1
|
||||
|| msg.indexOf("enoent") !== -1;
|
||||
return msg.indexOf("file does not exist") !== -1 || msg.indexOf("no such file") !== -1 || msg.indexOf("enoent") !== -1;
|
||||
}
|
||||
|
||||
function loadPluginSettings() {
|
||||
@@ -1942,6 +1947,12 @@ Singleton {
|
||||
}
|
||||
}
|
||||
|
||||
function setMatugenContrast(value) {
|
||||
if (matugenContrast === value)
|
||||
return;
|
||||
set("matugenContrast", value);
|
||||
}
|
||||
|
||||
function setRunUserMatugenTemplates(enabled) {
|
||||
if (runUserMatugenTemplates === enabled)
|
||||
return;
|
||||
|
||||
@@ -1249,10 +1249,7 @@ Singleton {
|
||||
const defaults = themeData.variants.defaults || {};
|
||||
const modeDefaults = defaults[colorMode] || defaults.dark || {};
|
||||
const isGreeterMode = typeof SessionData !== "undefined" && SessionData.isGreeterMode;
|
||||
const stored = isGreeterMode ?
|
||||
(GreetdSettings.registryThemeVariants[themeId]?.[colorMode] || modeDefaults) :
|
||||
(typeof SettingsData !== "undefined" ?
|
||||
SettingsData.getRegistryThemeMultiVariant(themeId, modeDefaults, colorMode) : modeDefaults);
|
||||
const stored = isGreeterMode ? (GreetdSettings.registryThemeVariants[themeId]?.[colorMode] || modeDefaults) : (typeof SettingsData !== "undefined" ? SettingsData.getRegistryThemeMultiVariant(themeId, modeDefaults, colorMode) : modeDefaults);
|
||||
var flavorId = stored.flavor || modeDefaults.flavor || "";
|
||||
const accentId = stored.accent || modeDefaults.accent || "";
|
||||
var flavor = findVariant(themeData.variants.flavors, flavorId);
|
||||
@@ -1279,9 +1276,7 @@ Singleton {
|
||||
|
||||
if (themeData.variants.options && themeData.variants.options.length > 0) {
|
||||
const isGreeterMode = typeof SessionData !== "undefined" && SessionData.isGreeterMode;
|
||||
const selectedVariantId = isGreeterMode
|
||||
? (typeof GreetdSettings.registryThemeVariants[themeId] === "string" ? GreetdSettings.registryThemeVariants[themeId] : themeData.variants.default)
|
||||
: (typeof SettingsData !== "undefined" ? SettingsData.getRegistryThemeVariant(themeId, themeData.variants.default) : themeData.variants.default);
|
||||
const selectedVariantId = isGreeterMode ? (typeof GreetdSettings.registryThemeVariants[themeId] === "string" ? GreetdSettings.registryThemeVariants[themeId] : themeData.variants.default) : (typeof SettingsData !== "undefined" ? SettingsData.getRegistryThemeVariant(themeId, themeData.variants.default) : themeData.variants.default);
|
||||
const variant = findVariant(themeData.variants.options, selectedVariantId);
|
||||
if (variant) {
|
||||
const variantColors = variant[colorMode] || variant.dark || variant.light || {};
|
||||
@@ -1554,6 +1549,9 @@ Singleton {
|
||||
if (typeof SettingsData !== "undefined" && SettingsData.terminalsAlwaysDark) {
|
||||
args.push("--terminals-always-dark");
|
||||
}
|
||||
if (typeof SettingsData !== "undefined" && SettingsData.matugenContrast !== 0) {
|
||||
args.push("--contrast", SettingsData.matugenContrast.toString());
|
||||
}
|
||||
|
||||
if (typeof SettingsData !== "undefined") {
|
||||
const skipTemplates = [];
|
||||
@@ -1654,12 +1652,8 @@ Singleton {
|
||||
const darkDefaults = defaults.dark || {};
|
||||
const lightDefaults = defaults.light || defaults.dark || {};
|
||||
const isGreeterMode = typeof SessionData !== "undefined" && SessionData.isGreeterMode;
|
||||
const storedDark = isGreeterMode
|
||||
? (GreetdSettings.registryThemeVariants[themeId]?.dark || darkDefaults)
|
||||
: (typeof SettingsData !== "undefined" ? SettingsData.getRegistryThemeMultiVariant(themeId, darkDefaults, "dark") : darkDefaults);
|
||||
const storedLight = isGreeterMode
|
||||
? (GreetdSettings.registryThemeVariants[themeId]?.light || lightDefaults)
|
||||
: (typeof SettingsData !== "undefined" ? SettingsData.getRegistryThemeMultiVariant(themeId, lightDefaults, "light") : lightDefaults);
|
||||
const storedDark = isGreeterMode ? (GreetdSettings.registryThemeVariants[themeId]?.dark || darkDefaults) : (typeof SettingsData !== "undefined" ? SettingsData.getRegistryThemeMultiVariant(themeId, darkDefaults, "dark") : darkDefaults);
|
||||
const storedLight = isGreeterMode ? (GreetdSettings.registryThemeVariants[themeId]?.light || lightDefaults) : (typeof SettingsData !== "undefined" ? SettingsData.getRegistryThemeMultiVariant(themeId, lightDefaults, "light") : lightDefaults);
|
||||
const darkFlavorId = storedDark.flavor || darkDefaults.flavor || "";
|
||||
const lightFlavorId = storedLight.flavor || lightDefaults.flavor || "";
|
||||
const accentId = storedDark.accent || darkDefaults.accent || "";
|
||||
@@ -1678,9 +1672,7 @@ Singleton {
|
||||
}
|
||||
} else if (customThemeRawData.variants.options) {
|
||||
const isGreeterMode = typeof SessionData !== "undefined" && SessionData.isGreeterMode;
|
||||
const selectedVariantId = isGreeterMode
|
||||
? (typeof GreetdSettings.registryThemeVariants[themeId] === "string" ? GreetdSettings.registryThemeVariants[themeId] : customThemeRawData.variants.default)
|
||||
: (typeof SettingsData !== "undefined" ? SettingsData.getRegistryThemeVariant(themeId, customThemeRawData.variants.default) : customThemeRawData.variants.default);
|
||||
const selectedVariantId = isGreeterMode ? (typeof GreetdSettings.registryThemeVariants[themeId] === "string" ? GreetdSettings.registryThemeVariants[themeId] : customThemeRawData.variants.default) : (typeof SettingsData !== "undefined" ? SettingsData.getRegistryThemeVariant(themeId, customThemeRawData.variants.default) : customThemeRawData.variants.default);
|
||||
const variant = findVariant(customThemeRawData.variants.options, selectedVariantId);
|
||||
if (variant) {
|
||||
darkTheme = mergeColors(darkTheme, variant.dark || {});
|
||||
|
||||
@@ -11,6 +11,7 @@ var SPEC = {
|
||||
customThemeFile: { def: "" },
|
||||
registryThemeVariants: { def: {} },
|
||||
matugenScheme: { def: "scheme-tonal-spot", onChange: "regenSystemThemes" },
|
||||
matugenContrast: { def: 0, onChange: "regenSystemThemes" },
|
||||
runUserMatugenTemplates: { def: true, onChange: "regenSystemThemes" },
|
||||
matugenTargetMonitor: { def: "", onChange: "regenSystemThemes" },
|
||||
|
||||
@@ -299,10 +300,10 @@ var SPEC = {
|
||||
matugenTemplateZed: { def: true },
|
||||
|
||||
matugenTemplateNeovimSettings: {
|
||||
def: {
|
||||
dark: { baseTheme: "github_dark", harmony: 0.5 },
|
||||
light: { baseTheme: "github_light", harmony: 0.5 }
|
||||
}
|
||||
def: {
|
||||
dark: { baseTheme: "github_dark", harmony: 0.5 },
|
||||
light: { baseTheme: "github_light", harmony: 0.5 }
|
||||
}
|
||||
},
|
||||
|
||||
showDock: { def: false },
|
||||
|
||||
@@ -517,7 +517,24 @@ Item {
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
color: Theme.surfaceVariantText
|
||||
wrapMode: Text.WordWrap
|
||||
width: parent.width
|
||||
width: parent.width - Theme.spacingM * 2
|
||||
x: Theme.spacingM
|
||||
}
|
||||
|
||||
SettingsSliderRow {
|
||||
tab: "theme"
|
||||
tags: ["matugen", "contrast", "dynamic"]
|
||||
settingKey: "matugenContrast"
|
||||
text: I18n.tr("Matugen Contrast")
|
||||
description: I18n.tr("Adjusts contrast of generated colors (-100 = minimum, 0 = standard, 100 = maximum)")
|
||||
value: Math.round(SettingsData.matugenContrast * 100)
|
||||
minimum: -100
|
||||
maximum: 100
|
||||
unit: "%"
|
||||
defaultValue: 0
|
||||
enabled: Theme.matugenAvailable
|
||||
opacity: enabled ? 1 : 0.4
|
||||
onSliderDragFinished: finalValue => SettingsData.setMatugenContrast(finalValue / 100)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user