1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-24 21:42:51 -05:00

add option to change occupied workspace color (#1427)

This commit is contained in:
Eggrror404
2026-01-19 02:25:37 +08:00
committed by GitHub
parent a685d9da52
commit 1adbf3937b
4 changed files with 68 additions and 1 deletions

View File

@@ -754,6 +754,16 @@ Item {
return !!(modelData && modelData.num === root.currentWorkspace);
return modelData === root.currentWorkspace;
}
property bool isOccupied: {
if (CompositorService.isHyprland)
return Array.from(Hyprland.toplevels?.values || [])
.some(tl => tl.workspace?.id === modelData?.id);
if (CompositorService.isDwl)
return modelData.clients > 0;
if (CompositorService.isNiri)
return NiriService.windows?.some(win => win.workspace_id === modelData?.id) ?? false;
return false;
}
property bool isPlaceholder: {
if (root.useExtWorkspace)
return !!(modelData && modelData.hidden);
@@ -835,6 +845,21 @@ Item {
}
}
readonly property color occupiedColor: {
switch (SettingsData.workspaceOccupiedColorMode) {
case "s":
return Theme.surface;
case "sc":
return Theme.surfaceContainer;
case "sch":
return Theme.surfaceContainerHigh;
case "none":
return unfocusedColor;
default:
return Theme.secondary;
}
}
readonly property color urgentColor: {
switch (SettingsData.workspaceUrgentColorMode) {
case "primary":
@@ -1022,7 +1047,7 @@ Item {
height: delegateRoot.visualHeight
anchors.centerIn: parent
radius: Theme.cornerRadius
color: isActive ? activeColor : isUrgent ? urgentColor : isPlaceholder ? Theme.surfaceTextLight : isHovered ? Theme.withAlpha(unfocusedColor, 0.7) : unfocusedColor
color: isActive ? activeColor : isUrgent ? urgentColor : isPlaceholder ? Theme.surfaceTextLight : isHovered ? Theme.withAlpha(unfocusedColor, 0.7) : isOccupied ? occupiedColor : unfocusedColor
border.width: isUrgent ? 2 : 0
border.color: isUrgent ? urgentColor : "transparent"