Loading icon for accounts until synced

This commit is contained in:
miruka
2019-08-27 15:00:50 -04:00
parent b457f46247
commit 6cb7589cca
5 changed files with 24 additions and 31 deletions

View File

@@ -3,6 +3,7 @@ import QtQuick.Controls 2.12
import QtQuick.Layouts 1.12
HRowLayout {
id: buttonContent
spacing: button.spacing
opacity: loading ? theme.loadingElementsOpacity :
enabled ? 1 : theme.disabledElementsOpacity
@@ -32,25 +33,14 @@ HRowLayout {
target: icon
property: "opacity"
from: 1
to: 0.3
to: 0.5
factor: 2
running: button.loading || false
onStopped: { [from, to] = [to, from]; start() }
onFinished: { [from, to] = [to, from]; start() }
}
HNumberAnimation {
target: icon
property: "scale"
from: 1
to: 0.92
factor: blink.factor
running: blink.running
onStopped: { [from, to] = [to, from]; start() }
}
SequentialAnimation {
running: blink.running
running: button.loading || false
loops: Animation.Infinite
HPauseAnimation { factor: blink.factor * 8 }

View File

@@ -56,6 +56,7 @@ HTileDelegate {
HButton {
id: expand
loading: ! model.data.first_sync_done || ! model.data.profile_updated
icon.name: "expand"
backgroundColor: "transparent"
padding: sidePane.currentSpacing / 1.5
@@ -64,13 +65,13 @@ HTileDelegate {
onClicked: accountDelegate.toggleCollapse()
visible: opacity > 0
opacity: accountDelegate.forceExpand ? 0 : 1
opacity: ! loading && accountDelegate.forceExpand ? 0 : 1
iconItem.transform: Rotation {
origin.x: expand.iconItem.dimension / 2
origin.y: expand.iconItem.dimension / 2
angle: expand.loading ? 0 : collapsed ? 180 : 90
angle: collapsed ? 180 : 90
Behavior on angle { HNumberAnimation {} }
}