From 6d034c853ea7cd6d426fccd79db90ec56e188327 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Sat, 13 May 2017 10:02:23 +0200 Subject: StatusBar as individual component --- components/kube/contents/ui/MailView.qml | 65 ++++---------------------------- 1 file changed, 7 insertions(+), 58 deletions(-) (limited to 'components') diff --git a/components/kube/contents/ui/MailView.qml b/components/kube/contents/ui/MailView.qml index 8ae2ffe4..2bbe6652 100644 --- a/components/kube/contents/ui/MailView.qml +++ b/components/kube/contents/ui/MailView.qml @@ -89,64 +89,13 @@ SplitView { color: Kube.Colors.viewBackgroundColor opacity: 0.3 } - - Repeater { - model: Kube.AccountsModel { - accountId: accountFolderview.currentAccount - } - - Column { - anchors { - top: border.bottom - left: statusBar.left - right: statusBar.right - bottom: statusBar.bottom - } - spacing: Kube.Units.smallSpacing - Kube.Label { - id: statusText - anchors.horizontalCenter: parent.horizontalCenter - visible: false - color: Kube.Colors.highlightedTextColor - states: [ - State { - name: "disconnected"; when: model.status == Kube.AccountsModel.OfflineStatus - PropertyChanges { target: statusBar; visible: true } - PropertyChanges { target: statusText; text: "Disconnected"; visible: true } - }, - State { - name: "busy"; when: model.status == Kube.AccountsModel.BusyStatus - PropertyChanges { target: statusBar; visible: true } - PropertyChanges { target: statusText; text: "Synchronizing..."; visible: true } - PropertyChanges { target: progressBar; visible: true } - }, - State { - name: "error"; when: model.status == Kube.AccountsModel.ErrorStatus - PropertyChanges { target: statusBar; visible: true } - //TODO get to an error description - PropertyChanges { target: statusText; text: "Error"; visible: true } - } - ] - } - Kube.ProgressBar { - id: progressBar - anchors.horizontalCenter: parent.horizontalCenter - height: 2 - width: parent.width - Kube.Units.smallSpacing * 2 - - indeterminate: true - visible: false - - Kube.Listener { - filter: Kube.Messages.progressNotification - onMessageReceived: { - progressBar.indeterminate = false - progressBar.from = 0 - progressBar.to = message.total - progressBar.value = message.progress - } - } - } + Kube.StatusBar { + accountId: accountFolderview.currentAccount + anchors { + top: border.bottom + left: statusBar.left + right: statusBar.right + bottom: statusBar.bottom } } } -- cgit v1.2.3