[ui] turn the reconnect action into a button

This commit is contained in:
dijunkun
2026-10-21 23:38:32 +08:00
parent a6f4df405b
commit 6422063df1
+18 -19
View File
@@ -1486,25 +1486,24 @@ export component MainWindow inherits Window {
text: root.current-version; text: root.current-version;
font-size: 11px; color: WorkbenchStyle.muted; vertical-alignment: center; font-size: 11px; color: WorkbenchStyle.muted; vertical-alignment: center;
} }
if !root.signal-connected && !root.signal-tls-error: Rectangle { if !root.signal-connected && !root.signal-tls-error: WorkbenchButton {
x: parent.width - self.width - 20px; x: parent.width - self.width - 20px;
y: 0px; y: (parent.height - self.height) / 2;
height: parent.height; width: max(64px, reconnect-label-metrics.preferred-width + 22px);
width: reconnect-label.preferred-width; height: 22px;
reconnect-label := Text { text: UiStrings.signal-reconnect;
text: UiStrings.signal-reconnect; text-size: 11px;
color: WorkbenchStyle.accent; text-color: WorkbenchStyle.accent;
font-size: 11px; clicked => {
horizontal-alignment: center; root.copy-feedback = CopyFeedback.idle;
vertical-alignment: center; root.signal-reconnect-requested();
} }
TouchArea { reconnect-label-metrics := Text {
mouse-cursor: pointer; visible: false;
clicked => { text: UiStrings.signal-reconnect;
root.copy-feedback = CopyFeedback.idle; font-size: 11px;
root.signal-reconnect-requested(); font-weight: 500;
} }
}
} }
} }
} }