From f11ddfb7fe53a129d3e051cd5d260ae3e1f3a210 Mon Sep 17 00:00:00 2001 From: Hannes Date: Sun, 5 Jul 2026 19:00:10 +0200 Subject: [PATCH] make the width nicer --- modules/bar/widgets/Workspaces.qml | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/modules/bar/widgets/Workspaces.qml b/modules/bar/widgets/Workspaces.qml index f5d5069..bc42dc5 100644 --- a/modules/bar/widgets/Workspaces.qml +++ b/modules/bar/widgets/Workspaces.qml @@ -30,13 +30,17 @@ Rectangle { id: wsItem property var workspaceData: modelData - - width: { - var cw = wsNum.width - if (wsIconsRow.children.length > 0) - cw += Config.spacing_fun(bar.height) + wsIconsRow.width - Math.max(cw + Config.spacing_fun(bar.height)*2, wsNum.height + Config.spacing_fun(bar.height)*2) - } + width: Math.max(40, wsIconsRow.width==0 ? wsNum.width + 2*Config.spacing_fun(bar.height) : wsNum.width + wsIconsRow.width + 3*Config.spacing_fun(bar.height)+Config.spacing_fun(bar.height)) + // width: { + // var spacing = Config.spacing_fun(bar.height) + // var cw = wsNum.width + // if (wsIconsRow.children.length > 0) { + // cw += spacing + wsIconsRow.width + spacing + // } else { + // cw += spacing * 2 + // } + // Math.max(cw, wsNum.height + spacing * 2) + // } height: workspacesContainer.height // highlight @@ -71,9 +75,9 @@ Rectangle { Row { anchors.left: parent.left - anchors.leftMargin: Config.spacing_fun(bar.height)*1.5 + anchors.leftMargin: wsIconsRow.width==0 ? (wsItem.width-wsNum.width)/2 : (wsItem.width-wsNum.width-wsIconsRow.width-Config.spacing_fun(bar.height))/2 anchors.verticalCenter: parent.verticalCenter - spacing: Config.spacing_fun(parent.height) + spacing: Config.spacing_fun(bar.height) Text { id: wsNum @@ -118,4 +122,4 @@ Rectangle { font.pixelSize: Config.iconSize(bar.height) anchors.centerIn: parent } -} +} \ No newline at end of file