From 3b2f307fe31eba0181be80241490a0c22edf0027 Mon Sep 17 00:00:00 2001 From: Lasan Mahaliyana Date: Fri, 27 Feb 2026 00:48:24 +0530 Subject: [PATCH] Fixed some UI bugs --- sharing/linux/qml_tray_app/FileShareTray.qml | 2 +- sharing/linux/qml_tray_app/components/AnimatedBlob.qml | 1 + sharing/linux/qml_tray_app/components/SideBar.qml | 8 ++++++-- sharing/linux/qml_tray_app/file_share_tray_controller.cc | 4 ++++ 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/sharing/linux/qml_tray_app/FileShareTray.qml b/sharing/linux/qml_tray_app/FileShareTray.qml index ded62aa1..d8f35309 100644 --- a/sharing/linux/qml_tray_app/FileShareTray.qml +++ b/sharing/linux/qml_tray_app/FileShareTray.qml @@ -54,7 +54,7 @@ ApplicationWindow { && fileShareController.transfers.length === 0 // ── Idle: animated blob ─────────────────────────────────── - AnimatedBlob {} + AnimatedBlob { visible: mainContent.isIdle } // ── Non-idle: scrollable device + transfer cards ────────── Flickable { diff --git a/sharing/linux/qml_tray_app/components/AnimatedBlob.qml b/sharing/linux/qml_tray_app/components/AnimatedBlob.qml index 668c6c39..5a16cb0b 100644 --- a/sharing/linux/qml_tray_app/components/AnimatedBlob.qml +++ b/sharing/linux/qml_tray_app/components/AnimatedBlob.qml @@ -9,6 +9,7 @@ Item { Label { x: 48; y: 48 + visible: fileShareController.running text: "Ready to receive" + (fileShareController.pendingSendFilePath.length > 0 ? " / send" : "") font.pixelSize: 20 font.weight: Font.Medium diff --git a/sharing/linux/qml_tray_app/components/SideBar.qml b/sharing/linux/qml_tray_app/components/SideBar.qml index a1239d5e..89961529 100644 --- a/sharing/linux/qml_tray_app/components/SideBar.qml +++ b/sharing/linux/qml_tray_app/components/SideBar.qml @@ -45,7 +45,9 @@ Item { Label { Layout.fillWidth: true - text: fileShareController.mode === "Send" ? "Discovering" : "Always visible" + text: !fileShareController.running + ? "Inactive" + : fileShareController.mode === "Send" ? "Discovering" : "Always visible" font.weight: Font.Medium color: textPrimary } @@ -63,7 +65,9 @@ Item { Layout.leftMargin: 12 Layout.topMargin: 8 Layout.rightMargin: 12 - text: fileShareController.mode === "Send" + text: !fileShareController.running + ? "The service is not running. Start it to discover or receive files." + : fileShareController.mode === "Send" ? "Discovering nearby devices. Select a device below to send your file." : "Nearby devices can share files with you. You'll be notified and must approve each transfer." wrapMode: Text.WordWrap diff --git a/sharing/linux/qml_tray_app/file_share_tray_controller.cc b/sharing/linux/qml_tray_app/file_share_tray_controller.cc index ba480503..9f20ff3c 100644 --- a/sharing/linux/qml_tray_app/file_share_tray_controller.cc +++ b/sharing/linux/qml_tray_app/file_share_tray_controller.cc @@ -929,6 +929,10 @@ void FileShareTrayController::AddDiscoveredDevice(const QString& endpoint_id) { if (discovered_devices_.contains(endpoint_id)) { return; } + // Skip ourselves – the peer name is set before this is called. + if (PeerLabelForEndpoint(endpoint_id).trimmed() == device_name_.trimmed()) { + return; + } discovered_devices_.append(endpoint_id); emit discoveredDevicesChanged(); }