From 8211b86ac643c84acc57fbfe83a49c734eecc6c4 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Fri, 17 Jul 2026 16:15:01 -0700 Subject: [PATCH] Restore compact status icon spacing --- shell/Ui/BarIndicator.qml | 4 ++++ shell/plugins/bar/widgets/Indicators.qml | 5 +++++ shell/plugins/bar/widgets/SystemUpdate.qml | 1 + test/shell.d/bar-icon-geometry-test.sh | 24 +++++++++++++++++++--- 4 files changed, 31 insertions(+), 3 deletions(-) diff --git a/shell/Ui/BarIndicator.qml b/shell/Ui/BarIndicator.qml index 21bbfaf7..c0c313b3 100644 --- a/shell/Ui/BarIndicator.qml +++ b/shell/Ui/BarIndicator.qml @@ -44,4 +44,8 @@ BarIconButton { maintainIndicatorReveal: indicatorBlock === "inactive" revealHost: indicatorHost fontSize: Style.font.caption + horizontalMargin: 5 + verticalPadding: 5 + fixedWidth: -1 + fixedHeight: -1 } diff --git a/shell/plugins/bar/widgets/Indicators.qml b/shell/plugins/bar/widgets/Indicators.qml index 0785fd6d..854be75d 100644 --- a/shell/plugins/bar/widgets/Indicators.qml +++ b/shell/plugins/bar/widgets/Indicators.qml @@ -16,6 +16,7 @@ BarWidget { property bool indicatorItemHovered: false readonly property bool alwaysShowIndicators: setting("alwaysShow", false) === true readonly property bool revealInactiveIndicators: alwaysShowIndicators || indicatorAreaHovered || indicatorItemHovered || (bar && bar.centerSectionRevealHeld === true && bar.centerHoverRevealSuppressed !== true) + readonly property bool hasVisibleIndicators: activeIndicatorIds.length > 0 || revealInactiveIndicators signal refreshRequested() @@ -187,6 +188,8 @@ BarWidget { visible: !root.vertical spacing: 0 + leftPadding: root.hasVisibleIndicators ? Style.spacing.sm : 0 + rightPadding: leftPadding HoverHandler { onHoveredChanged: root.setIndicatorAreaHovered(hovered) @@ -229,6 +232,8 @@ BarWidget { visible: root.vertical spacing: 0 + topPadding: root.hasVisibleIndicators ? Style.spaceReal(1.5) : 0 + bottomPadding: topPadding HoverHandler { onHoveredChanged: root.setIndicatorAreaHovered(hovered) diff --git a/shell/plugins/bar/widgets/SystemUpdate.qml b/shell/plugins/bar/widgets/SystemUpdate.qml index b6563741..edcd8980 100644 --- a/shell/plugins/bar/widgets/SystemUpdate.qml +++ b/shell/plugins/bar/widgets/SystemUpdate.qml @@ -57,6 +57,7 @@ BarWidget { anchors.fill: parent bar: root.bar text: "\uf021" + fontSize: Style.font.caption tooltipText: "" onPressed: root.runUpdate() } diff --git a/test/shell.d/bar-icon-geometry-test.sh b/test/shell.d/bar-icon-geometry-test.sh index fae4b579..44a707f2 100644 --- a/test/shell.d/bar-icon-geometry-test.sh +++ b/test/shell.d/bar-icon-geometry-test.sh @@ -69,8 +69,8 @@ ShellRoot { fail("vertical icon does not use the shared slot") return } - if (verticalIndicator.implicitWidth !== Style.bar.sizeVertical || verticalIndicator.implicitHeight !== Style.bar.iconSlot) { - fail("vertical indicator does not use the shared slot") + if (verticalIndicator.implicitWidth !== Style.bar.sizeVertical || verticalIndicator.implicitHeight >= Style.bar.iconSlot) { + fail("vertical indicator does not retain compact spacing") return } if (verticalIndicator.glyphFontSize !== Style.font.caption) { @@ -81,6 +81,15 @@ ShellRoot { fail("vertical indicator is not optically centered") return } + if (horizontalIndicator.implicitWidth >= Style.bar.iconSlot) { + fail("horizontal indicator does not retain compact spacing") + return + } + if (horizontalIndicatorPair.implicitWidth >= Style.bar.iconSlot * 2 + || verticalIndicatorPair.implicitHeight >= Style.bar.iconSlot * 2) { + fail("indicator groups do not retain compact internal spacing") + return + } console.log("RESULT pass") Qt.quit() }) @@ -124,7 +133,16 @@ ShellRoot { iconComponent: Component { Rectangle { width: 12; height: 12 } } } BarIconButton { id: verticalIcon; bar: verticalBar; text: "\uf021" } - BarIndicator { id: verticalIndicator; bar: verticalBar; active: true; activeText: "󰅶" } + Row { + id: horizontalIndicatorPair + BarIndicator { id: horizontalIndicator; bar: testBar; active: true; activeText: "󰅶" } + BarIndicator { bar: testBar; active: true; activeText: "󰔎" } + } + Column { + id: verticalIndicatorPair + BarIndicator { id: verticalIndicator; bar: verticalBar; active: true; activeText: "󰅶" } + BarIndicator { bar: verticalBar; active: true; activeText: "󰔎" } + } } QML