mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2025-12-07 05:55:37 -05:00
update workspace indicators and qmlformat
This commit is contained in:
@@ -97,9 +97,9 @@ ScrollView {
|
||||
}
|
||||
onValueChanged: (value) => {
|
||||
Prefs.setIconTheme(value);
|
||||
if (value !== "System Default" && !Prefs.qt5ctAvailable && !Prefs.qt6ctAvailable) {
|
||||
if (value !== "System Default" && !Prefs.qt5ctAvailable && !Prefs.qt6ctAvailable)
|
||||
ToastService.showWarning("qt5ct or qt6ct not found - Qt app themes may not update without these tools");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -108,9 +108,9 @@ ScrollView {
|
||||
text: "Font Family"
|
||||
description: "Select system font family"
|
||||
currentValue: {
|
||||
if (Prefs.fontFamily === Prefs.defaultFontFamily) {
|
||||
if (Prefs.fontFamily === Prefs.defaultFontFamily)
|
||||
return "Default";
|
||||
}
|
||||
|
||||
return Prefs.fontFamily || "Default";
|
||||
}
|
||||
enableFuzzySearch: true
|
||||
@@ -119,47 +119,35 @@ ScrollView {
|
||||
options: {
|
||||
var fonts = ["Default"];
|
||||
var availableFonts = Qt.fontFamilies();
|
||||
|
||||
var rootFamilies = [];
|
||||
var seenFamilies = new Set();
|
||||
|
||||
// Filter to root family names by removing common weight/style suffixes
|
||||
for (var i = 0; i < availableFonts.length; i++) {
|
||||
var fontName = availableFonts[i];
|
||||
|
||||
// Skip fonts beginning with . (like .AppleSystem)
|
||||
if (fontName.startsWith(".")) {
|
||||
if (fontName.startsWith("."))
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
// Skip the default font since we already added it as recommended
|
||||
if (fontName === Prefs.defaultFontFamily) {
|
||||
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, "")
|
||||
.replace(/ (UI|Display|Text|Mono|Sans|Serif)$/i, function(match, suffix) {
|
||||
// Keep these suffixes as they're part of the family name
|
||||
return match;
|
||||
})
|
||||
.trim();
|
||||
|
||||
|
||||
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, "").replace(/ (UI|Display|Text|Mono|Sans|Serif)$/i, function(match, suffix) {
|
||||
// Keep these suffixes as they're part of the family name
|
||||
return match;
|
||||
}).trim();
|
||||
if (!seenFamilies.has(rootName) && rootName !== "") {
|
||||
seenFamilies.add(rootName);
|
||||
rootFamilies.push(rootName);
|
||||
}
|
||||
}
|
||||
|
||||
return fonts.concat(rootFamilies.sort());
|
||||
}
|
||||
onValueChanged: (value) => {
|
||||
if (value === "Default") {
|
||||
if (value === "Default")
|
||||
Prefs.setFontFamily(Prefs.defaultFontFamily);
|
||||
} else {
|
||||
else
|
||||
Prefs.setFontFamily(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -168,33 +156,63 @@ ScrollView {
|
||||
text: "Font Weight"
|
||||
description: "Select font weight"
|
||||
currentValue: {
|
||||
switch(Prefs.fontWeight) {
|
||||
case Font.Thin: return "Thin";
|
||||
case Font.ExtraLight: return "Extra Light";
|
||||
case Font.Light: return "Light";
|
||||
case Font.Normal: return "Regular";
|
||||
case Font.Medium: return "Medium";
|
||||
case Font.DemiBold: return "Demi Bold";
|
||||
case Font.Bold: return "Bold";
|
||||
case Font.ExtraBold: return "Extra Bold";
|
||||
case Font.Black: return "Black";
|
||||
default: return "Regular";
|
||||
switch (Prefs.fontWeight) {
|
||||
case Font.Thin:
|
||||
return "Thin";
|
||||
case Font.ExtraLight:
|
||||
return "Extra Light";
|
||||
case Font.Light:
|
||||
return "Light";
|
||||
case Font.Normal:
|
||||
return "Regular";
|
||||
case Font.Medium:
|
||||
return "Medium";
|
||||
case Font.DemiBold:
|
||||
return "Demi Bold";
|
||||
case Font.Bold:
|
||||
return "Bold";
|
||||
case Font.ExtraBold:
|
||||
return "Extra Bold";
|
||||
case Font.Black:
|
||||
return "Black";
|
||||
default:
|
||||
return "Regular";
|
||||
}
|
||||
}
|
||||
options: ["Thin", "Extra Light", "Light", "Regular", "Medium", "Demi Bold", "Bold", "Extra Bold", "Black"]
|
||||
onValueChanged: (value) => {
|
||||
var weight;
|
||||
switch(value) {
|
||||
case "Thin": weight = Font.Thin; break;
|
||||
case "Extra Light": weight = Font.ExtraLight; break;
|
||||
case "Light": weight = Font.Light; break;
|
||||
case "Regular": weight = Font.Normal; break;
|
||||
case "Medium": weight = Font.Medium; break;
|
||||
case "Demi Bold": weight = Font.DemiBold; break;
|
||||
case "Bold": weight = Font.Bold; break;
|
||||
case "Extra Bold": weight = Font.ExtraBold; break;
|
||||
case "Black": weight = Font.Black; break;
|
||||
default: weight = Font.Normal; break;
|
||||
switch (value) {
|
||||
case "Thin":
|
||||
weight = Font.Thin;
|
||||
break;
|
||||
case "Extra Light":
|
||||
weight = Font.ExtraLight;
|
||||
break;
|
||||
case "Light":
|
||||
weight = Font.Light;
|
||||
break;
|
||||
case "Regular":
|
||||
weight = Font.Normal;
|
||||
break;
|
||||
case "Medium":
|
||||
weight = Font.Medium;
|
||||
break;
|
||||
case "Demi Bold":
|
||||
weight = Font.DemiBold;
|
||||
break;
|
||||
case "Bold":
|
||||
weight = Font.Bold;
|
||||
break;
|
||||
case "Extra Bold":
|
||||
weight = Font.ExtraBold;
|
||||
break;
|
||||
case "Black":
|
||||
weight = Font.Black;
|
||||
break;
|
||||
default:
|
||||
weight = Font.Normal;
|
||||
break;
|
||||
}
|
||||
Prefs.setFontWeight(weight);
|
||||
}
|
||||
@@ -205,9 +223,9 @@ ScrollView {
|
||||
text: "Monospace Font"
|
||||
description: "Select monospace font for process list and technical displays"
|
||||
currentValue: {
|
||||
if (Prefs.monoFontFamily === Prefs.defaultMonoFontFamily) {
|
||||
if (Prefs.monoFontFamily === Prefs.defaultMonoFontFamily)
|
||||
return "Default";
|
||||
}
|
||||
|
||||
return Prefs.monoFontFamily || "Default";
|
||||
}
|
||||
enableFuzzySearch: true
|
||||
@@ -216,62 +234,41 @@ ScrollView {
|
||||
options: {
|
||||
var fonts = ["Default"];
|
||||
var availableFonts = Qt.fontFamilies();
|
||||
|
||||
var monoFamilies = [];
|
||||
var seenFamilies = new Set();
|
||||
|
||||
// Filter to likely monospace fonts
|
||||
for (var i = 0; i < availableFonts.length; i++) {
|
||||
var fontName = availableFonts[i];
|
||||
|
||||
// Skip fonts beginning with .
|
||||
if (fontName.startsWith(".")) {
|
||||
if (fontName.startsWith("."))
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
// Skip the default mono font since we already added it as recommended
|
||||
if (fontName === Prefs.defaultMonoFontFamily) {
|
||||
if (fontName === Prefs.defaultMonoFontFamily)
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
// Look for common monospace indicators
|
||||
var lowerName = fontName.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")) {
|
||||
|
||||
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, "")
|
||||
.trim();
|
||||
|
||||
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")) {
|
||||
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, "").trim();
|
||||
if (!seenFamilies.has(rootName) && rootName !== "") {
|
||||
seenFamilies.add(rootName);
|
||||
monoFamilies.push(rootName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return fonts.concat(monoFamilies.sort());
|
||||
}
|
||||
onValueChanged: (value) => {
|
||||
if (value === "Default") {
|
||||
if (value === "Default")
|
||||
Prefs.setMonoFontFamily(Prefs.defaultMonoFontFamily);
|
||||
} else {
|
||||
else
|
||||
Prefs.setMonoFontFamily(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Transparency Settings Section
|
||||
|
||||
Reference in New Issue
Block a user