From 49f19b617a51eb3a556b775023c93731d1e73855 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sat, 16 May 2026 15:55:33 +0200 Subject: [PATCH] Better spacing --- default/quickshell/omarchy-shell/plugins/bar/Bar.qml | 7 ++++--- .../omarchy-shell/plugins/bar/common/WidgetButton.qml | 4 +++- .../omarchy-shell/plugins/bar/widgets/networkPanel.qml | 1 + 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/default/quickshell/omarchy-shell/plugins/bar/Bar.qml b/default/quickshell/omarchy-shell/plugins/bar/Bar.qml index a89eae33..60542d35 100644 --- a/default/quickshell/omarchy-shell/plugins/bar/Bar.qml +++ b/default/quickshell/omarchy-shell/plugins/bar/Bar.qml @@ -1318,6 +1318,7 @@ Item { property string fontFamily: root.fontFamily property real fontSize: 12 property real horizontalMargin: 7.5 + property real rightExtraMargin: 0 property real verticalPadding: 6 property real textRotation: 0 property real fixedWidth: -1 @@ -1329,12 +1330,13 @@ Item { visible: text !== "" || keepSpace opacity: text === "" ? 0 : 1 - implicitWidth: fixedWidth > 0 ? fixedWidth : (root.vertical ? root.barSize : Math.max(12, label.implicitWidth + horizontalMargin * 2)) + implicitWidth: fixedWidth > 0 ? fixedWidth : (root.vertical ? root.barSize : Math.max(12, label.implicitWidth + horizontalMargin * 2 + rightExtraMargin)) implicitHeight: fixedHeight > 0 ? fixedHeight : (root.vertical ? Math.max(12, label.implicitHeight + verticalPadding * 2) : root.barSize) Text { id: label anchors.centerIn: parent + anchors.horizontalCenterOffset: root.vertical ? 0 : -buttonRoot.rightExtraMargin / 2 text: buttonRoot.text color: buttonRoot.active ? root.urgent : root.foreground font.family: buttonRoot.fontFamily @@ -1885,20 +1887,19 @@ Item { text: root.bluetoothIcon() horizontalMargin: 8.5 visible: Bluetooth.defaultAdapter !== null - tooltipText: root.bluetoothTooltip() onPressed: function() { root.run("omarchy-launch-bluetooth") } } component NetworkModule: ModuleButton { text: root.networkIcon() horizontalMargin: 6.5 + rightExtraMargin: 2 tooltipText: root.networkTooltip() onPressed: function() { root.run("OMARCHY_PATH=" + root.shellQuote(root.omarchyPath) + " PATH=" + root.shellQuote(root.omarchyPath + "/bin:" + (Quickshell.env("PATH") || "")) + " " + root.shellQuote(root.omarchyPath + "/bin/omarchy-launch-wifi")) } } component AudioModule: ModuleButton { text: root.audioIcon() - tooltipText: root.audioTooltip() onPressed: function(button) { if (button === Qt.RightButton) root.run("pamixer -t") else root.run("omarchy-launch-audio") diff --git a/default/quickshell/omarchy-shell/plugins/bar/common/WidgetButton.qml b/default/quickshell/omarchy-shell/plugins/bar/common/WidgetButton.qml index fc371c7e..8f59b8d6 100644 --- a/default/quickshell/omarchy-shell/plugins/bar/common/WidgetButton.qml +++ b/default/quickshell/omarchy-shell/plugins/bar/common/WidgetButton.qml @@ -11,6 +11,7 @@ Item { property color activeColor: bar ? bar.urgent : "#a55555" property bool active: false property real horizontalMargin: 8.5 + property real rightExtraMargin: 0 property real verticalPadding: 6 property real fixedWidth: -1 property real fixedHeight: -1 @@ -26,7 +27,7 @@ Item { visible: text !== "" || keepSpace opacity: text === "" ? 0 : 1 - implicitWidth: fixedWidth > 0 ? fixedWidth : (vertical ? barSize : Math.max(12, label.implicitWidth + horizontalMargin * 2)) + implicitWidth: fixedWidth > 0 ? fixedWidth : (vertical ? barSize : Math.max(12, label.implicitWidth + horizontalMargin * 2 + rightExtraMargin)) implicitHeight: fixedHeight > 0 ? fixedHeight : (vertical ? Math.max(12, label.implicitHeight + verticalPadding * 2) : barSize) Behavior on opacity { @@ -36,6 +37,7 @@ Item { Text { id: label anchors.centerIn: parent + anchors.horizontalCenterOffset: root.vertical ? 0 : -root.rightExtraMargin / 2 text: root.text color: root.active ? root.activeColor : root.foreground font.family: root.fontFamily diff --git a/default/quickshell/omarchy-shell/plugins/bar/widgets/networkPanel.qml b/default/quickshell/omarchy-shell/plugins/bar/widgets/networkPanel.qml index 02262002..924f5db3 100644 --- a/default/quickshell/omarchy-shell/plugins/bar/widgets/networkPanel.qml +++ b/default/quickshell/omarchy-shell/plugins/bar/widgets/networkPanel.qml @@ -186,6 +186,7 @@ iwctl station "$station" get-networks rssi-dbms 2>/dev/null \\ bar: root.bar text: root.icon horizontalMargin: 8.5 + rightExtraMargin: 2 tooltipText: bar ? bar.networkTooltip() : "" onPressed: function(b) {