From 2be8327d161624f8d466a1fc3b1cfab351df378f Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Tue, 29 Apr 2025 21:43:26 +1000 Subject: bar: occupied workspaces no need for layout Can just use anchors and bindings instead --- modules/bar/components/workspaces/OccupiedBg.qml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'modules/bar/components/workspaces') diff --git a/modules/bar/components/workspaces/OccupiedBg.qml b/modules/bar/components/workspaces/OccupiedBg.qml index 520443f..194846a 100644 --- a/modules/bar/components/workspaces/OccupiedBg.qml +++ b/modules/bar/components/workspaces/OccupiedBg.qml @@ -5,7 +5,7 @@ import "root:/config" import QtQuick import QtQuick.Layouts -BoxLayout { +Item { id: root required property bool vertical @@ -13,9 +13,8 @@ BoxLayout { required property var occupied required property int groupOffset - anchors.centerIn: parent + anchors.fill: parent opacity: BarConfig.workspaces.occupiedBg ? 1 : 0 - spacing: 0 z: -1 Repeater { @@ -37,9 +36,13 @@ BoxLayout { topRightRadius: roundRight bottomRightRadius: roundRight - // Ugh stupid size errors on reload - Layout.preferredWidth: root.vertical ? BarConfig.sizes.innerHeight : root.workspaces[index]?.width ?? 1 - Layout.preferredHeight: root.vertical ? root.workspaces[index]?.height ?? 1 : BarConfig.sizes.innerHeight + x: root.workspaces[index]?.x ?? 0 + y: root.workspaces[index]?.y ?? 0 + width: root.vertical ? BarConfig.sizes.innerHeight : root.workspaces[index]?.width ?? 1 + height: root.vertical ? root.workspaces[index]?.height ?? 1 : BarConfig.sizes.innerHeight + + anchors.horizontalCenter: root.vertical ? parent.horizontalCenter : undefined + anchors.verticalCenter: root.vertical ? undefined : parent.verticalCenter states: [ State { -- cgit v1.2.3-freya