diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2025-07-10 13:44:43 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2025-07-10 13:44:43 +0800 |
| commit | fcb01c5fe06d19f33eb17c0b41f2ec49a5eeb500 (patch) | |
| tree | a1be17293c43efd999734659fc2801837efb0e4d /bar/Workspace.qml | |
| parent | ca9fcf800485ac5dff633275d56f0b33c4670225 (diff) | |
good
Diffstat (limited to 'bar/Workspace.qml')
| -rw-r--r-- | bar/Workspace.qml | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/bar/Workspace.qml b/bar/Workspace.qml index 9c78e30..afdc776 100644 --- a/bar/Workspace.qml +++ b/bar/Workspace.qml @@ -1,11 +1,11 @@ -import "../services" -import "../config" import QtQuick.Layouts import QtQuick import Quickshell +import "../services" +import "../config" Item { - Layout.preferredHeight: 50 + Layout.fillHeight: true Layout.preferredWidth: parent.width / 3 property list<bool> workspaceOccupied: [] @@ -14,15 +14,17 @@ Item { // workspaceOccupied = Array.from({ length: Config.options.bar.workspaces.shown }, (_, i) => { // return Hyprland.workspaces.values.some(ws => ws.id === workspaceGroup * Config.options.bar.workspaces.shown + i + 1); // }) - workspaceOccupied = Array.from({ length: Bar.workspaces }, (_, i) => { - return Hyprland.workspaces.values.some(ws => ws.id === (i + 1)); - }); + workspaceOccupied = Array.from({ + length: Bar.workspaces + }, (_, i) => { + return Hyprland.workspaces.values.some(ws => ws.id === (i + 1)); + }); } function isActive(index: int): bool { Hyprland.focusedWorkspace.id.toString() == (index + 1).toString(); } function isOccupied(index: int): bool { - return workspaceOccupied[index] === true; + return workspaceOccupied[index] === true; } Connections { @@ -42,7 +44,7 @@ Item { Rectangle { Text { - text: Hyprland.focusedWorkspace.id.toString() == (index + 1).toString() + text: Hyprland.focusedWorkspace?.id.toString() == (index + 1).toString() // text: isActive(index) } implicitWidth: 10 |
