workspaces: replace reduce with for loop for occupied map
This commit is contained in:
parent
ca06d13d27
commit
51579474c5
1 changed files with 6 additions and 4 deletions
|
|
@ -16,10 +16,12 @@ StyledClippingRect {
|
||||||
readonly property bool onSpecial: (Config.bar.workspaces.perMonitorWorkspaces ? Hypr.monitorFor(screen) : Hypr.focusedMonitor)?.lastIpcObject?.specialWorkspace?.name !== ""
|
readonly property bool onSpecial: (Config.bar.workspaces.perMonitorWorkspaces ? Hypr.monitorFor(screen) : Hypr.focusedMonitor)?.lastIpcObject?.specialWorkspace?.name !== ""
|
||||||
readonly property int activeWsId: Config.bar.workspaces.perMonitorWorkspaces ? (Hypr.monitorFor(screen).activeWorkspace?.id ?? 1) : Hypr.activeWsId
|
readonly property int activeWsId: Config.bar.workspaces.perMonitorWorkspaces ? (Hypr.monitorFor(screen).activeWorkspace?.id ?? 1) : Hypr.activeWsId
|
||||||
|
|
||||||
readonly property var occupied: Hypr.workspaces.values.reduce((acc, curr) => {
|
readonly property var occupied: {
|
||||||
acc[curr.id] = curr.lastIpcObject.windows > 0;
|
const occ = {};
|
||||||
return acc;
|
for (const ws of Hypr.workspaces.values)
|
||||||
}, {})
|
occ[ws.id] = ws.lastIpcObject.windows > 0;
|
||||||
|
return occ;
|
||||||
|
}
|
||||||
readonly property int groupOffset: Math.floor((activeWsId - 1) / Config.bar.workspaces.shown) * Config.bar.workspaces.shown
|
readonly property int groupOffset: Math.floor((activeWsId - 1) / Config.bar.workspaces.shown) * Config.bar.workspaces.shown
|
||||||
|
|
||||||
property real blur: onSpecial ? 1 : 0
|
property real blur: onSpecial ? 1 : 0
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue