From df979ec5fa21bfae272b656786860d60b791c6c6 Mon Sep 17 00:00:00 2001 From: miruka Date: Wed, 4 Nov 2020 09:01:44 -0400 Subject: [PATCH] Show spinner while push rule list is loading --- .../Pages/AccountSettings/Notifications.qml | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/gui/Pages/AccountSettings/Notifications.qml b/src/gui/Pages/AccountSettings/Notifications.qml index e3484e49..c533bcbc 100644 --- a/src/gui/Pages/AccountSettings/Notifications.qml +++ b/src/gui/Pages/AccountSettings/Notifications.qml @@ -51,6 +51,22 @@ HListView { model: ModelStore.get(userId, "pushrules") implicitHeight: Math.min(window.height, contentHeight + bottomMargin) + header: HColumnLayout { + width: root.width + + HLoader { + source: "../../Base/HBusyIndicator.qml" + active: root.model.count === 0 + opacity: active ? 1 : 0 + visible: opacity > 0 + + Behavior on opacity { HNumberAnimation {} } + + Layout.alignment: Qt.AlignCenter + Layout.topMargin: theme.spacing + } + } + section.property: "kind" section.delegate: HLabel { width: root.width @@ -88,9 +104,6 @@ HListView { } } - Layout.fillWidth: true - Layout.fillHeight: true - FlickShortcuts { flickable: root active: ! mainUI.debugConsole.visible && root.enableFlickShortcuts