From d33f9d504ca53e73a260f0b88fe5838e26b9d1ef Mon Sep 17 00:00:00 2001 From: Jozef Mlich Date: Fri, 15 Nov 2024 14:32:57 +0100 Subject: [PATCH] Loader for busy indicator --- ui/qml/components/platform.silica/PageListPL.qml | 8 ++++++++ ui/qml/pages/PairPage.qml | 14 +++++++++----- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/ui/qml/components/platform.silica/PageListPL.qml b/ui/qml/components/platform.silica/PageListPL.qml index 60ea5161..71ecca31 100644 --- a/ui/qml/components/platform.silica/PageListPL.qml +++ b/ui/qml/components/platform.silica/PageListPL.qml @@ -35,12 +35,20 @@ Page { property alias pageMenu: menuLoader.sourceComponent property alias placeholderEnabled: viewPlaceholder.enabled property alias placeholderText: viewPlaceholder.hintText + property alias background: backgroundLoader.sourceComponent property string title signal pageStatusActivating signal pageStatusActive signal pageStatusInactive + + Loader { + id: backgroundLoader + active: sourceComponent ? true : false + anchors.centerIn: parent + } + SilicaListView { id: listView anchors.fill: parent diff --git a/ui/qml/pages/PairPage.qml b/ui/qml/pages/PairPage.qml index 655facef..7ef226ca 100644 --- a/ui/qml/pages/PairPage.qml +++ b/ui/qml/pages/PairPage.qml @@ -11,7 +11,9 @@ PageListPL { title: qsTr("Pair Device") placeholderText: qsTr("No devices found") - placeholderEnabled: (delegateModel.count === 0) && !busyIndicator.running + placeholderEnabled: (delegateModel.count === 0) && !busy + property bool busy: (adapter && adapter.discovering && !page.count) || DaemonInterfaceInstance.connectionState == "pairing" + //busy: discoveryModel.running || DaemonInterfaceInstance.pairing property string deviceType property variant aliases @@ -110,7 +112,7 @@ PageListPL { delegate: ListItemPL { id: listItem contentHeight: styler.themeItemSizeLarge -// visible: model.FriendlyName.indexOf(deviceType) >= 0 + visible: model.FriendlyName.indexOf(deviceType) >= 0 onClicked: { AmazfishConfig.pairedAddress = ""; AmazfishConfig.pairedName = ""; @@ -189,11 +191,13 @@ PageListPL { } } - background: - BusyIndicatorPL { + background: BusyIndicatorPL { id: busyIndicator anchors.centerIn: parent - running: (adapter && adapter.discovering && !page.count) || DaemonInterfaceInstance.connectionState == "pairing" + running: busy } + + + }