1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-28 07:22:50 -05:00

update workspace indicators and qmlformat

This commit is contained in:
bbedward
2025-07-28 13:16:27 -04:00
parent 4581544585
commit b1db088828
16 changed files with 476 additions and 478 deletions

View File

@@ -76,7 +76,7 @@ Item {
}
}
}
if (searchQuery.length === 0) {
if (searchQuery.length === 0)
apps = apps.sort(function(a, b) {
var aId = a.id || (a.execString || a.exec || "");
var bId = b.id || (b.execString || b.exec || "");
@@ -84,9 +84,10 @@ Item {
var bUsage = appUsageRanking[bId] ? appUsageRanking[bId].usageCount : 0;
if (aUsage !== bUsage)
return bUsage - aUsage;
return (a.name || "").localeCompare(b.name || "");
});
}
// Convert to model format and populate
apps.forEach((app) => {
if (app)

View File

@@ -51,6 +51,8 @@ PanelWindow {
}
Rectangle {
// Animation finished, now we can safely resize
id: mainContainer
readonly property real targetWidth: Math.min(Screen.width * 0.9, 600)
@@ -98,8 +100,6 @@ PanelWindow {
y: Theme.barHeight + 4
// Only resize after animation is complete
onOpacityChanged: {
// Animation finished, now we can safely resize
if (opacity === 1)
Qt.callLater(() => {
height = calculateHeight();

View File

@@ -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

View File

@@ -133,6 +133,7 @@ ScrollView {
Prefs.setWeatherLocation(displayName, coordinates);
}
}
}
}

View File

@@ -18,7 +18,6 @@ Rectangle {
const baseColor = clockMouseArea.containsMouse ? Theme.primaryHover : Theme.surfaceTextHover;
return Qt.rgba(baseColor.r, baseColor.g, baseColor.b, baseColor.a * Theme.widgetTransparency);
}
Component.onCompleted: {
root.currentDate = systemClock.date;
}

View File

@@ -19,7 +19,6 @@ Rectangle {
const baseColor = cpuArea.containsMouse ? Theme.primaryPressed : Theme.secondaryHover;
return Qt.rgba(baseColor.r, baseColor.g, baseColor.b, baseColor.a * Theme.widgetTransparency);
}
Component.onCompleted: {
SysMonitorService.addRef();
}

View File

@@ -17,9 +17,9 @@ Rectangle {
radius: Theme.cornerRadius
color: {
// Only show background when there's content to display
if (!FocusedWindowService.focusedAppName && !FocusedWindowService.focusedWindowTitle) {
if (!FocusedWindowService.focusedAppName && !FocusedWindowService.focusedWindowTitle)
return "transparent";
}
const baseColor = mouseArea.containsMouse ? Theme.primaryHover : Theme.surfaceTextHover;
return Qt.rgba(baseColor.r, baseColor.g, baseColor.b, baseColor.a * Theme.widgetTransparency);
}

View File

@@ -22,7 +22,6 @@ Rectangle {
const baseColor = Theme.surfaceTextHover;
return Qt.rgba(baseColor.r, baseColor.g, baseColor.b, baseColor.a * Theme.widgetTransparency);
}
states: [
State {
name: "shown"
@@ -115,7 +114,6 @@ Rectangle {
title = activePlayer.trackTitle || "Unknown Track";
subtitle = activePlayer.trackArtist || "";
}
return subtitle.length > 0 ? title + " • " + subtitle : title;
}
font.pixelSize: Theme.fontSizeSmall
@@ -251,4 +249,4 @@ Rectangle {
}
}
}

View File

@@ -19,7 +19,6 @@ Rectangle {
const baseColor = ramArea.containsMouse ? Theme.primaryPressed : Theme.secondaryHover;
return Qt.rgba(baseColor.r, baseColor.g, baseColor.b, baseColor.a * Theme.widgetTransparency);
}
Component.onCompleted: {
SysMonitorService.addRef();
}

View File

@@ -12,9 +12,9 @@ Rectangle {
radius: Theme.cornerRadius
color: {
// Only show background when there are system tray items to display
if (systemTrayRow.children.length === 0) {
if (systemTrayRow.children.length === 0)
return "transparent";
}
const baseColor = Theme.secondaryHover;
return Qt.rgba(baseColor.r, baseColor.g, baseColor.b, baseColor.a * Theme.widgetTransparency);
}

View File

@@ -133,9 +133,9 @@ Rectangle {
visible: Prefs.showWorkspaceIndex
anchors.centerIn: parent
text: isPlaceholder ? sequentialNumber : sequentialNumber
color: isPlaceholder ? Theme.surfaceTextAlpha : Theme.surfaceText
font.pixelSize: Theme.fontSizeMedium
font.bold: isActive && !isPlaceholder
color: isActive ? Qt.rgba(Theme.surfaceContainer.r, Theme.surfaceContainer.g, Theme.surfaceContainer.b, 0.95) : isPlaceholder ? Theme.surfaceTextAlpha : Theme.surfaceTextMedium
font.pixelSize: Theme.fontSizeSmall
font.weight: isActive && !isPlaceholder ? Font.DemiBold : Font.Normal
}
Behavior on width {

View File

@@ -9,10 +9,8 @@ import qs.Widgets
PanelWindow {
id: root
property var modelData
screen: modelData
property bool volumePopupVisible: false
function show() {
@@ -26,6 +24,7 @@ PanelWindow {
}
screen: modelData
visible: volumePopupVisible
WlrLayershell.layer: WlrLayershell.Overlay
WlrLayershell.exclusiveZone: -1