make the width nicer

This commit is contained in:
Hannes
2026-07-05 19:00:10 +02:00
parent 6ebd2bf648
commit f11ddfb7fe
+14 -10
View File
@@ -30,13 +30,17 @@ Rectangle {
id: wsItem id: wsItem
property var workspaceData: modelData property var workspaceData: modelData
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: { // width: {
var cw = wsNum.width // var spacing = Config.spacing_fun(bar.height)
if (wsIconsRow.children.length > 0) // var cw = wsNum.width
cw += Config.spacing_fun(bar.height) + wsIconsRow.width // if (wsIconsRow.children.length > 0) {
Math.max(cw + Config.spacing_fun(bar.height)*2, wsNum.height + Config.spacing_fun(bar.height)*2) // cw += spacing + wsIconsRow.width + spacing
} // } else {
// cw += spacing * 2
// }
// Math.max(cw, wsNum.height + spacing * 2)
// }
height: workspacesContainer.height height: workspacesContainer.height
// highlight // highlight
@@ -71,9 +75,9 @@ Rectangle {
Row { Row {
anchors.left: parent.left 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 anchors.verticalCenter: parent.verticalCenter
spacing: Config.spacing_fun(parent.height) spacing: Config.spacing_fun(bar.height)
Text { Text {
id: wsNum id: wsNum
@@ -118,4 +122,4 @@ Rectangle {
font.pixelSize: Config.iconSize(bar.height) font.pixelSize: Config.iconSize(bar.height)
anchors.centerIn: parent anchors.centerIn: parent
} }
} }