mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-06-08 04:09:15 -04:00
fix(fonts): auto-rebuild font cache when configured fonts are missing
- Add Fonts category to dms doctor for manual diagnostics - Fix a default font setting warning
This commit is contained in:
@@ -594,6 +594,7 @@ function getValidKeys() {
|
||||
|
||||
function set(root, key, value, saveFn, hooks) {
|
||||
if (!(key in SPEC)) return;
|
||||
if (value === undefined || value === null) value = SPEC[key].def;
|
||||
root[key] = value;
|
||||
var hookName = SPEC[key].onChange;
|
||||
if (hookName && hooks && hooks[hookName]) {
|
||||
|
||||
@@ -41,7 +41,7 @@ Item {
|
||||
var fontName2 = availableFonts[j];
|
||||
if (fontName2.startsWith("."))
|
||||
continue;
|
||||
if (fontName2 === SettingsData.defaultMonoFontFamily)
|
||||
if (fontName2 === Theme.defaultMonoFontFamily)
|
||||
continue;
|
||||
var lowerName = fontName2.toLowerCase();
|
||||
if (lowerName.includes("mono") || lowerName.includes("code") || lowerName.includes("console") || lowerName.includes("terminal") || lowerName.includes("courier") || lowerName.includes("dejavu sans mono") || lowerName.includes("jetbrains") || lowerName.includes("fira") || lowerName.includes("hack") || lowerName.includes("source code") || lowerName.includes("ubuntu mono") || lowerName.includes("cascadia")) {
|
||||
|
||||
@@ -226,13 +226,13 @@ Item {
|
||||
text: I18n.tr("Monospace Font")
|
||||
description: I18n.tr("Select monospace font for process list and technical displays")
|
||||
options: root.fontsEnumerated ? root.cachedMonoFamilies : ["Default"]
|
||||
currentValue: SettingsData.monoFontFamily === SettingsData.defaultMonoFontFamily ? "Default" : (SettingsData.monoFontFamily || "Default")
|
||||
currentValue: SettingsData.monoFontFamily === Theme.defaultMonoFontFamily ? "Default" : (SettingsData.monoFontFamily || "Default")
|
||||
enableFuzzySearch: true
|
||||
popupWidthOffset: 100
|
||||
maxPopupHeight: 400
|
||||
onValueChanged: value => {
|
||||
if (value === "Default")
|
||||
SettingsData.set("monoFontFamily", SettingsData.defaultMonoFontFamily);
|
||||
SettingsData.set("monoFontFamily", Theme.defaultMonoFontFamily);
|
||||
else
|
||||
SettingsData.set("monoFontFamily", value);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user