From c2e212c1eb641a1ce9249ef9add8093de4041c31 Mon Sep 17 00:00:00 2001 From: miruka Date: Sun, 10 May 2020 15:29:18 -0400 Subject: [PATCH] Add syncing indicator to AccountsBar accounts --- src/gui/Base/HButtonContent.qml | 5 ++--- src/gui/MainPane/AccountsBar.qml | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/src/gui/Base/HButtonContent.qml b/src/gui/Base/HButtonContent.qml index 7f2d2c98..0da9fb1f 100644 --- a/src/gui/Base/HButtonContent.qml +++ b/src/gui/Base/HButtonContent.qml @@ -51,12 +51,11 @@ HRowLayout { width: height height: parent.height opacity: button.loading ? 1 : 0 + active: opacity > 0 + sourceComponent: HBusyIndicator {} Behavior on opacity { HNumberAnimation {} } - - sourceComponent: HBusyIndicator { - } } } diff --git a/src/gui/MainPane/AccountsBar.qml b/src/gui/MainPane/AccountsBar.qml index a82e6d35..38a35475 100644 --- a/src/gui/MainPane/AccountsBar.qml +++ b/src/gui/MainPane/AccountsBar.qml @@ -53,6 +53,7 @@ HColumnLayout { rightPadding: leftPadding contentItem: Item { + id: tileContent implicitHeight: avatar.height HUserAvatar { @@ -76,6 +77,24 @@ HColumnLayout { unreads: model.total_unread mentions: model.total_mentions } + + HLoader { + anchors.fill: parent + opacity: model.first_sync_done ? 0 : 1 + + active: opacity > 0 + sourceComponent: Rectangle { + color: utils.hsluv(0, 0, 0, 0.5) + + HBusyIndicator { + anchors.centerIn: parent + width: tileContent.width / 2 + height: width + } + } + + Behavior on opacity { HNumberAnimation {} } + } } contextMenu: AccountContextMenu { userId: model.id }