Skip to content

Commit

Permalink
Loader for busy indicator
Browse files Browse the repository at this point in the history
  • Loading branch information
jmlich committed Nov 15, 2024
1 parent f102e8e commit d33f9d5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
8 changes: 8 additions & 0 deletions ui/qml/components/platform.silica/PageListPL.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 9 additions & 5 deletions ui/qml/pages/PairPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 = "";
Expand Down Expand Up @@ -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
}



}

0 comments on commit d33f9d5

Please sign in to comment.