diff --git a/discover/qml/ApplicationsListPage.qml b/discover/qml/ApplicationsListPage.qml --- a/discover/qml/ApplicationsListPage.qml +++ b/discover/qml/ApplicationsListPage.qml @@ -78,5 +78,76 @@ application: model.application compact: page.compact } + + Kirigami.Label { + anchors.centerIn: parent + opacity: apps.count == 0 && !appsModel.isBusy ? 0.3 : 0 + Behavior on opacity { PropertyAnimation { duration: Kirigami.Units.longDuration; easing.type: Easing.InOutQuad; } } + text: i18n("Sorry, nothing found...") + } + + BusyIndicator { + id: busyIndicator + anchors { + top: parent.bottom + horizontalCenter: parent.horizontalCenter + margins: Kirigami.Units.largeSpacing + } + running: false + opacity: 0 + states: [ + State { + name: "running"; + when: appsModel.isBusy + PropertyChanges { target: busyIndicator; opacity: 1; running: true; } + AnchorChanges { target: busyIndicator; anchors.bottom: parent.bottom; anchors.top: undefined; } + } + ] + transitions: [ + Transition { + from: "" + to: "running" + SequentialAnimation { + PauseAnimation { duration: Kirigami.Units.longDuration * 5; } + ParallelAnimation { + AnchorAnimation { duration: Kirigami.Units.longDuration; easing.type: Easing.InOutQuad; } + PropertyAnimation { property: "opacity"; duration: Kirigami.Units.longDuration; easing.type: Easing.InOutQuad; } + } + } + }, + Transition { + from: "running" + to: "" + ParallelAnimation { + AnchorAnimation { duration: Kirigami.Units.shortDuration; easing.type: Easing.InOutQuad; } + PropertyAnimation { property: "opacity"; duration: Kirigami.Units.shortDuration; easing.type: Easing.InOutQuad; } + } + } + ] + Kirigami.Label { + id: busyLabel + anchors { + horizontalCenter: parent.horizontalCenter + bottom: parent.top + } + text: i18n("Still looking...") + opacity: 0 + states: [ + State { + name: "running"; + when: busyIndicator.opacity === 1; + PropertyChanges { target: busyLabel; opacity: 1; } + } + ] + transitions: Transition { + from: "" + to: "running" + SequentialAnimation { + PauseAnimation { duration: Kirigami.Units.longDuration * 5; } + PropertyAnimation { property: "opacity"; duration: Kirigami.Units.longDuration * 10; easing.type: Easing.InOutCubic; } + } + } + } + } } }