mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-24 13:32:50 -05:00
workspaces: fix occupied color overridworkspacs: fix occupied color
overridee
This commit is contained in:
@@ -206,7 +206,7 @@ Singleton {
|
||||
property bool reverseScrolling: false
|
||||
property bool dwlShowAllTags: false
|
||||
property string workspaceColorMode: "default"
|
||||
property string workspaceOccupiedColorMode: "default"
|
||||
property string workspaceOccupiedColorMode: "none"
|
||||
property string workspaceUnfocusedColorMode: "default"
|
||||
property string workspaceUrgentColorMode: "default"
|
||||
property bool workspaceFocusedBorderEnabled: false
|
||||
|
||||
@@ -100,7 +100,7 @@ var SPEC = {
|
||||
reverseScrolling: { def: false },
|
||||
dwlShowAllTags: { def: false },
|
||||
workspaceColorMode: { def: "default" },
|
||||
workspaceOccupiedColorMode: { def: "default" },
|
||||
workspaceOccupiedColorMode: { def: "none" },
|
||||
workspaceUnfocusedColorMode: { def: "default" },
|
||||
workspaceUrgentColorMode: { def: "default" },
|
||||
workspaceFocusedBorderEnabled: { def: false },
|
||||
|
||||
@@ -757,12 +757,13 @@ Item {
|
||||
}
|
||||
property bool isOccupied: {
|
||||
if (CompositorService.isHyprland)
|
||||
return Array.from(Hyprland.toplevels?.values || [])
|
||||
.some(tl => tl.workspace?.id === modelData?.id);
|
||||
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;
|
||||
if (CompositorService.isNiri) {
|
||||
const workspace = NiriService.allWorkspaces.find(ws => ws.idx + 1 === modelData && ws.output === root.effectiveScreenName);
|
||||
return workspace ? (NiriService.windows?.some(win => win.workspace_id === workspace.id) ?? false) : false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
property bool isPlaceholder: {
|
||||
@@ -848,16 +849,18 @@ Item {
|
||||
|
||||
readonly property color occupiedColor: {
|
||||
switch (SettingsData.workspaceOccupiedColorMode) {
|
||||
case "sec":
|
||||
return Theme.secondary;
|
||||
case "s":
|
||||
return Theme.surface;
|
||||
case "sc":
|
||||
return Theme.surfaceContainer;
|
||||
case "sch":
|
||||
return Theme.surfaceContainerHigh;
|
||||
case "none":
|
||||
return unfocusedColor;
|
||||
case "schh":
|
||||
return Theme.surfaceContainerHighest;
|
||||
default:
|
||||
return Theme.secondary;
|
||||
return unfocusedColor;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -201,7 +201,7 @@ Item {
|
||||
|
||||
SettingsButtonGroupRow {
|
||||
text: I18n.tr("Occupied Color")
|
||||
model: ["sec", "s", "sc", "sch", "none"]
|
||||
model: ["none", "sec", "s", "sc", "sch", "schh"]
|
||||
visible: CompositorService.isNiri || CompositorService.isHyprland || CompositorService.isDwl
|
||||
buttonHeight: 22
|
||||
minButtonWidth: 36
|
||||
@@ -210,15 +210,17 @@ Item {
|
||||
textSize: Theme.fontSizeSmall - 1
|
||||
spacing: 1
|
||||
currentIndex: {
|
||||
switch (SettingsData.wokspaceColorMode) {
|
||||
case "s":
|
||||
switch (SettingsData.workspaceOccupiedColorMode) {
|
||||
case "sec":
|
||||
return 1;
|
||||
case "sc":
|
||||
case "s":
|
||||
return 2;
|
||||
case "sch":
|
||||
case "sc":
|
||||
return 3;
|
||||
case "none":
|
||||
case "sch":
|
||||
return 4;
|
||||
case "schh":
|
||||
return 5;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
@@ -226,7 +228,7 @@ Item {
|
||||
onSelectionChanged: (index, selected) => {
|
||||
if (!selected)
|
||||
return;
|
||||
const modes = ["default", "s", "sc", "sch", "none"];
|
||||
const modes = ["none", "sec", "s", "sc", "sch", "schh"];
|
||||
SettingsData.set("workspaceOccupiedColorMode", modes[index]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user