From f30fbb36ca248be7f2e6ef95c2308f58374eee88 Mon Sep 17 00:00:00 2001 From: lucy Date: Fri, 17 Jul 2026 23:43:54 +0200 Subject: [PATCH] redo bar right and left padding logic --- modules/bar/Bar.qml | 6 +++--- modules/bar/Ws.qml | 11 ++++++----- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/modules/bar/Bar.qml b/modules/bar/Bar.qml index e9ddc34..43d2f5f 100644 --- a/modules/bar/Bar.qml +++ b/modules/bar/Bar.qml @@ -11,7 +11,7 @@ Variants { delegate: WlrLayershell { id: root required property var modelData - property double moduleHeight: implicitHeight - 12 + property double moduleHeight: implicitHeight - 10 screen: modelData anchors { top: true @@ -36,7 +36,7 @@ Variants { spacing: 5 anchors.left: parent.left anchors.verticalCenter: parent.verticalCenter - anchors.leftMargin: Config.rounding == 0 ? Config.floating ? 0 : 10 : Config.barHeight / 4 + anchors.leftMargin: Config.rounding == 0 ? Config.floating ? 0 : 10 : root.moduleHeight / 4 Ws { moduleHeight: root.moduleHeight barScreen: root.modelData @@ -60,7 +60,7 @@ Variants { anchors.right: parent.right anchors.verticalCenter: parent.verticalCenter spacing: 5 - anchors.rightMargin: Config.rounding == 0 ? Config.floating ? 0 : 10 : Config.barHeight / 4 + anchors.rightMargin: Config.rounding == 0 ? Config.floating ? 0 : 10 : root.moduleHeight / 4 Mpris { moduleHeight: root.moduleHeight } diff --git a/modules/bar/Ws.qml b/modules/bar/Ws.qml index 87226d8..4a92985 100644 --- a/modules/bar/Ws.qml +++ b/modules/bar/Ws.qml @@ -14,14 +14,14 @@ Rectangle { required property double moduleHeight radius: Config.rounding color: 'transparent' - implicitWidth: wsLayout.implicitWidth + implicitWidth: wsLayout.implicitWidth + 10 implicitHeight: moduleHeight RowLayout { id: wsLayout anchors.centerIn: root anchors.horizontalCenter: parent.horizontalCenter - spacing: 0 + spacing: 10 Repeater { id: wsRepeater model: Hyprland.workspaces @@ -33,14 +33,15 @@ Rectangle { visible: Hyprland.monitorFor(root.barScreen) === wsWrapper.modelData.monitor implicitHeight: root.moduleHeight - implicitWidth: 16 + implicitWidth: wsName.width parent: wsLayout color: 'transparent' radius: Config.rounding StyledText { + id: wsName anchors.centerIn: parent - text: wsWrapper.modelData.id > 10 ? wsWrapper.modelData.id > 20 ? wsWrapper.modelData.id - 20 : wsWrapper.modelData.id - 10 : wsWrapper.modelData.id + text: wsWrapper.modelData.name color: wsWrapper.active ? Colors.base0D : Colors.base04 opacity: wsWrapper.active ? 1.0 : 0.4 font.bold: wsWrapper.active @@ -50,7 +51,7 @@ Rectangle { anchors.fill: parent acceptedButtons: Qt.LeftButton cursorShape: Qt.PointingHandCursor - onClicked: wsWrapper.ws.activate() + onClicked: wsWrapper.modelData.activate() } } }