diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-04-30 14:10:48 +1000 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-04-30 14:10:48 +1000 |
| commit | efd09ae86eb5c089c5873c4dfb717af7b081d1fa (patch) | |
| tree | 19a28341714535f03244add078009d43f6618f92 | |
| parent | bar: some workspaces optimisations (diff) | |
| download | caelestia-shell-efd09ae86eb5c089c5873c4dfb717af7b081d1fa.tar.gz caelestia-shell-efd09ae86eb5c089c5873c4dfb717af7b081d1fa.tar.bz2 caelestia-shell-efd09ae86eb5c089c5873c4dfb717af7b081d1fa.zip | |
bar: fix workspaces anims
Also fix hyprland undef error
| -rw-r--r-- | modules/bar/components/workspaces/ActiveIndicator.qml | 2 | ||||
| -rw-r--r-- | modules/bar/components/workspaces/OccupiedBg.qml | 8 | ||||
| -rw-r--r-- | modules/bar/components/workspaces/Workspace.qml | 2 | ||||
| -rw-r--r-- | services/Hyprland.qml | 2 |
4 files changed, 4 insertions, 10 deletions
diff --git a/modules/bar/components/workspaces/ActiveIndicator.qml b/modules/bar/components/workspaces/ActiveIndicator.qml index 7e7ad8d..ba5c006 100644 --- a/modules/bar/components/workspaces/ActiveIndicator.qml +++ b/modules/bar/components/workspaces/ActiveIndicator.qml @@ -17,7 +17,7 @@ Rectangle { property int currentIdx: Hyprland.activeWsId - 1 - groupOffset property real leading: workspaces[currentIdx][vertical ? "y" : "x"] property real trailing: workspaces[currentIdx][vertical ? "y" : "x"] - property real currentSize: workspaces[currentIdx][vertical ? "height" : "width"] + property real currentSize: workspaces[currentIdx].size property real size: Math.abs(leading - trailing) + currentSize property real offset: Math.min(leading, trailing) diff --git a/modules/bar/components/workspaces/OccupiedBg.qml b/modules/bar/components/workspaces/OccupiedBg.qml index c35cd33..b808ecd 100644 --- a/modules/bar/components/workspaces/OccupiedBg.qml +++ b/modules/bar/components/workspaces/OccupiedBg.qml @@ -88,14 +88,6 @@ Item { Behavior on y { Anim {} } - - Behavior on width { - Anim {} - } - - Behavior on height { - Anim {} - } } } diff --git a/modules/bar/components/workspaces/Workspace.qml b/modules/bar/components/workspaces/Workspace.qml index c5d7475..53f7c59 100644 --- a/modules/bar/components/workspaces/Workspace.qml +++ b/modules/bar/components/workspaces/Workspace.qml @@ -15,6 +15,8 @@ Item { required property int groupOffset readonly property bool isWorkspace: true // Flag for finding workspace children + // Unanimated prop for others to use as reference + readonly property real size: childrenRect[vertical ? "height" : "width"] + (isOccupied ? Appearance.padding.normal : 0) readonly property int ws: groupOffset + index + 1 readonly property bool isOccupied: occupied[ws] ?? false diff --git a/services/Hyprland.qml b/services/Hyprland.qml index f47c0cb..286bee3 100644 --- a/services/Hyprland.qml +++ b/services/Hyprland.qml @@ -49,7 +49,7 @@ Singleton { const len = rClients.length; for (let i = 0; i < len; i++) { const client = rClients[i]; - if (!clients.find(c => c.address === client.address)) + if (!clients.find(c => c.address === client?.address)) rClients.splice(i, 1); } |