From f89a735d5115eca6826d7848ef09d58e7b14542a Mon Sep 17 00:00:00 2001 From: jack Date: Thu, 11 Jun 2026 13:16:37 -0700 Subject: [PATCH] refactor: update TabBar and live indicator for improved connection status handling and visual feedback --- src/pygui/ISC/Tabs/WaferMapTab.qml | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/pygui/ISC/Tabs/WaferMapTab.qml b/src/pygui/ISC/Tabs/WaferMapTab.qml index 0edc5de..0dce1b7 100644 --- a/src/pygui/ISC/Tabs/WaferMapTab.qml +++ b/src/pygui/ISC/Tabs/WaferMapTab.qml @@ -37,6 +37,7 @@ Item { // Mode toggle TabBar { id: modeBar + currentIndex: 1 // Default to "Review" spacing: 2 padding: 2 background: Rectangle { @@ -47,9 +48,11 @@ Item { } TabButton { text: "Live" + enabled: deviceController.connectionStatus === "Connected" + opacity: enabled ? 1.0 : 0.4 implicitWidth: 58; implicitHeight: 28 background: Rectangle { - color: parent.checked ? Theme.buttonNeutralBackground : "transparent" + color: parent.checked ? Theme.tabActiveBackground : "transparent" radius: Theme.radiusSm - 1 } contentItem: Text { @@ -65,7 +68,7 @@ Item { text: "Review" implicitWidth: 64; implicitHeight: 28 background: Rectangle { - color: parent.checked ? Theme.buttonNeutralBackground : "transparent" + color: parent.checked ? Theme.tabActiveBackground : "transparent" radius: Theme.radiusSm - 1 } contentItem: Text { @@ -87,10 +90,21 @@ Item { spacing: 5 // WiFi icon (Unicode approximation; swap for SVG if available) Label { + id: liveIndicator text: "◉" - color: streamController.state !== "idle" + color: (deviceController.connectionStatus === "Connected" && streamController.state !== "idle") ? Theme.liveColor : Theme.bodyColor font.pixelSize: 13 + + SequentialAnimation on opacity { + running: deviceController.connectionStatus === "Connected" && streamController.state !== "idle" + loops: Animation.Infinite + NumberAnimation { to: 0.2; duration: 600; easing.type: Easing.InOutQuad } + NumberAnimation { to: 1.0; duration: 600; easing.type: Easing.InOutQuad } + onRunningChanged: { + if (!running) liveIndicator.opacity = 1.0 + } + } } Label { text: "Live stream"