bar: fix workspaces anims

Also fix hyprland undef error
This commit is contained in:
2 * r + 2 * t 2025-04-30 14:10:48 +10:00
parent 96c8226def
commit efd09ae86e
4 changed files with 4 additions and 10 deletions

View file

@ -17,7 +17,7 @@ Rectangle {
property int currentIdx: Hyprland.activeWsId - 1 - groupOffset property int currentIdx: Hyprland.activeWsId - 1 - groupOffset
property real leading: workspaces[currentIdx][vertical ? "y" : "x"] property real leading: workspaces[currentIdx][vertical ? "y" : "x"]
property real trailing: 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 size: Math.abs(leading - trailing) + currentSize
property real offset: Math.min(leading, trailing) property real offset: Math.min(leading, trailing)

View file

@ -88,14 +88,6 @@ Item {
Behavior on y { Behavior on y {
Anim {} Anim {}
} }
Behavior on width {
Anim {}
}
Behavior on height {
Anim {}
}
} }
} }

View file

@ -15,6 +15,8 @@ Item {
required property int groupOffset required property int groupOffset
readonly property bool isWorkspace: true // Flag for finding workspace children 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 int ws: groupOffset + index + 1
readonly property bool isOccupied: occupied[ws] ?? false readonly property bool isOccupied: occupied[ws] ?? false

View file

@ -49,7 +49,7 @@ Singleton {
const len = rClients.length; const len = rClients.length;
for (let i = 0; i < len; i++) { for (let i = 0; i < len; i++) {
const client = rClients[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); rClients.splice(i, 1);
} }