From 725136e3d6246f502b5ae2127399181bbd90bec7 Mon Sep 17 00:00:00 2001 From: mayaanhafeez Date: Fri, 28 Aug 2026 11:01:20 -0600 Subject: [PATCH 1/2] Fix lopsided cursor highlight on network panel header actions The QR and speed-test header buttons used raw Button components with asymmetric horizontal/vertical padding, producing a highlight box wider than tall around their near-square icons. Swap them for PanelActionButton, the canonical square inline-action component already used elsewhere in the kit (e.g. connectPwBtn), which sizes itself symmetrically around the icon. Fixes #8782 Co-Authored-By: Claude Sonnet 5 --- shell/plugins/panels/network/Panel.qml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/shell/plugins/panels/network/Panel.qml b/shell/plugins/panels/network/Panel.qml index dea1d280a66c..b79a44070cc3 100644 --- a/shell/plugins/panels/network/Panel.qml +++ b/shell/plugins/panels/network/Panel.qml @@ -1107,32 +1107,28 @@ Panel { anchors.right: parent.right anchors.verticalCenter: parent.verticalCenter - Button { + PanelActionButton { id: qrAction visible: root.canShareWifi iconText: "󰐲" tooltipText: "Show QR code" foreground: root.bar.foreground fontFamily: root.bar.fontFamily - iconSize: Style.font.subtitle * 1.5 - horizontalPadding: Style.space(5) - verticalPadding: Style.space(2) + fontSize: Style.font.subtitle * 1.5 hasCursor: root.qrHeaderHasCursor Layout.alignment: Qt.AlignVCenter onHovered: function(on) { if (on) root.setHeaderCursor(root.qrHeaderIndex) } onClicked: root.summonWifiQr() } - Button { + PanelActionButton { id: speedAction visible: root.canRunSpeedTest iconText: "󰓅" tooltipText: "Run a speed test" foreground: root.bar.foreground fontFamily: root.bar.fontFamily - iconSize: Style.font.subtitle * 1.5 - horizontalPadding: Style.space(5) - verticalPadding: Style.space(2) + fontSize: Style.font.subtitle * 1.5 hasCursor: root.speedHeaderHasCursor Layout.alignment: Qt.AlignVCenter onHovered: function(on) { if (on) root.setHeaderCursor(root.speedHeaderIndex) } From ed36f81da73400a7397c6f365a472405f0f31602 Mon Sep 17 00:00:00 2001 From: mayaanhafeez Date: Fri, 9 Oct 2026 01:40:19 -0600 Subject: [PATCH 2/2] Center icons in PanelActionButton on whole pixels A fractional size and anchors.centerIn put the glyph on half-pixel coordinates, so it rounded a pixel off the center of the fill: the speed-test icon sat low in the network header. Round the size, make it odd so odd-width glyphs get even margins, and place the icon on whole pixels. Co-authored-by: Fabian Behrendt <7931874+fabianbehrendt@users.noreply.github.com> --- shell/Ui/PanelActionButton.qml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/shell/Ui/PanelActionButton.qml b/shell/Ui/PanelActionButton.qml index 8a1b10bce09d..04bb3f3abd77 100644 --- a/shell/Ui/PanelActionButton.qml +++ b/shell/Ui/PanelActionButton.qml @@ -33,7 +33,9 @@ BorderSurface { property color hoverColor: foreground property string fontFamily: Style.font.family property real fontSize: Style.font.icon - property real size: Math.max(Style.space(22), fontSize + Style.spacing.sm * 2) + // Whole and odd, so an icon glyph (usually an odd number of pixels wide) + // has the same space on both sides instead of one pixel more on one side. + property real size: Math.round(Math.max(Style.space(22), fontSize + Style.spacing.sm * 2)) | 1 property bool focusable: false property bool hasCursor: false @@ -69,7 +71,9 @@ BorderSurface { Behavior on color { ColorAnimation { duration: 60 } } Text { - anchors.centerIn: parent + // Snap to whole pixels so the glyph doesn't round away from the fill's center. + x: Math.round((root.width - width) / 2) + y: Math.round((root.height - height) / 2) text: root.iconText color: root.enabled ? (root._hot ? root.hoverColor : root.foreground)