1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2025-12-06 21:45:38 -05:00

font re-work, change default to inter variable + fira code

This commit is contained in:
bbedward
2025-07-28 11:24:24 -04:00
parent f16e7a506e
commit 03b8370c14
9 changed files with 419 additions and 92 deletions

View File

@@ -100,10 +100,22 @@ ScrollView {
width: parent.width
text: "Font Family"
description: "Select system font family"
currentValue: Prefs.fontFamily || "System Default"
currentValue: {
if (Prefs.fontFamily === Prefs.defaultFontFamily) {
return "Default";
}
return Prefs.fontFamily || "System Default";
}
enableFuzzySearch: true
popupWidthOffset: 100
maxPopupHeight: 400
options: {
var fonts = ["System Default"];
var availableFonts = Qt.fontFamilies();
// Add default font at the top
fonts.push("Default");
var rootFamilies = [];
var seenFamilies = new Set();
@@ -116,6 +128,11 @@ ScrollView {
continue;
}
// Skip the default font since we already added it as recommended
if (fontName === Prefs.defaultFontFamily) {
continue;
}
var rootName = fontName
.replace(/ (Thin|Extra Light|Light|Regular|Medium|Semi Bold|Demi Bold|Bold|Extra Bold|Black|Heavy)$/i, "")
.replace(/ (Italic|Oblique|Condensed|Extended|Narrow|Wide)$/i, "")
@@ -134,7 +151,13 @@ ScrollView {
return fonts.concat(rootFamilies.sort());
}
onValueChanged: (value) => {
Prefs.setFontFamily(value === "System Default" ? "Noto Sans" : value);
if (value === "System Default") {
Prefs.setFontFamily(Prefs.defaultFontFamily);
} else if (value === "Default") {
Prefs.setFontFamily(Prefs.defaultFontFamily);
} else {
Prefs.setFontFamily(value);
}
}
}
@@ -179,10 +202,22 @@ ScrollView {
width: parent.width
text: "Monospace Font"
description: "Select monospace font for process list and technical displays"
currentValue: Prefs.monoFontFamily || "System Default"
currentValue: {
if (Prefs.monoFontFamily === Prefs.defaultMonoFontFamily) {
return "Default";
}
return Prefs.monoFontFamily || "System Default";
}
enableFuzzySearch: true
popupWidthOffset: 100
maxPopupHeight: 400
options: {
var fonts = ["System Default"];
var availableFonts = Qt.fontFamilies();
// Add default mono font at the top
fonts.push("Default");
var monoFamilies = [];
var seenFamilies = new Set();
@@ -195,6 +230,11 @@ ScrollView {
continue;
}
// Skip the default mono font since we already added it as recommended
if (fontName === Prefs.defaultMonoFontFamily) {
continue;
}
// Look for common monospace indicators
var lowerName = fontName.toLowerCase();
if (lowerName.includes("mono") ||
@@ -225,7 +265,13 @@ ScrollView {
return fonts.concat(monoFamilies.sort());
}
onValueChanged: (value) => {
Prefs.setMonoFontFamily(value === "System Default" ? "JetBrains Mono" : value);
if (value === "System Default") {
Prefs.setMonoFontFamily(Prefs.defaultMonoFontFamily);
} else if (value === "Default") {
Prefs.setMonoFontFamily(Prefs.defaultMonoFontFamily);
} else {
Prefs.setMonoFontFamily(value);
}
}
}
}