From bbdf6cfa61a8aa47888de0ec3ca95f58e60a6633 Mon Sep 17 00:00:00 2001 From: Andre Padez Date: Sat, 15 Aug 2026 22:43:41 +0100 Subject: [PATCH] Make the tailnet label open the panel MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The label was a plain Text with its own MouseArea, which is not registered in bar.clickTargets. While a panel is open, KeyboardPanel puts a full-screen overlay above everything and forwards clicks landing in the bar strip only to registered targets — so a left click opened the panel and then had the same click treated as "outside", dismissing it. It looked like nothing happened. Right click was unaffected because toggleOffscale() never involves the panel. Use a WidgetButton instead: it registers itself via syncClickRegistration() and renders the label text natively, so both the Text and the MouseArea go away. Left toggles the panel, right toggles Offscale, middle refreshes — the same three buttons as the icon, so the widget reads as one target. `dimmed` handles the inactive state rather than darkening the colour, since Qt.darker on yellow shifts the hue to olive. Co-Authored-By: Claude Opus 5 --- Panel.qml | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/Panel.qml b/Panel.qml index f569a21..6277f1c 100644 --- a/Panel.qml +++ b/Panel.qml @@ -403,18 +403,31 @@ Panel { anchors.fill: parent spacing: Style.space(4) - Text { + // A WidgetButton rather than a plain Text with a MouseArea, because + // WidgetButton registers itself in bar.clickTargets. That registration is + // what makes left-click work: while a panel is open, KeyboardPanel puts a + // full-screen overlay above everything and forwards clicks in the bar strip + // only to registered targets. An unregistered MouseArea would open the + // panel on press and then have the same click treated as "outside" and + // dismiss it — the panel appeared not to open at all. + WidgetButton { id: tailnetLabel visible: text !== "" + bar: root.bar text: root.tailnetName - // Brand yellow. Dimmed by opacity rather than by darkening the colour - // when Tailscale is off — Qt.darker on yellow slides the hue to olive - // instead of just quietening it, the same trap as the IP/DNS subtitle. - color: root.accent - opacity: tailscale.active ? 1.0 : 0.5 - font.family: root.fontFamily - font.pixelSize: Style.bar.iconFont + // Brand yellow. `dimmed` fades the whole button when Tailscale is off, + // rather than darkening the colour — Qt.darker on yellow slides the hue + // to olive instead of quietening it, the same trap as the IP/DNS line. + foreground: root.accent + useActiveColor: false + dimmed: !tailscale.active + fontSize: Style.bar.iconFont anchors.verticalCenter: parent.verticalCenter + onPressed: function(buttonCode) { + if (buttonCode === Qt.RightButton) tailscale.toggleOffscale() + else if (buttonCode === Qt.MiddleButton) tailscale.refresh() + else root.toggle() + } } BarIconButton {