From 433bdc462fcd8fd8fd6737b37b4a2f8c4fcde0ac Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Sat, 20 May 2017 12:33:58 +0200 Subject: Dont refrence outside root in statusbar --- components/kube/contents/ui/MailView.qml | 16 ++++++++-------- framework/qml/StatusBar.qml | 8 ++++---- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/components/kube/contents/ui/MailView.qml b/components/kube/contents/ui/MailView.qml index da96bd28..23d09b1f 100644 --- a/components/kube/contents/ui/MailView.qml +++ b/components/kube/contents/ui/MailView.qml @@ -57,26 +57,25 @@ SplitView { anchors { top: newMailButton.bottom topMargin: Kube.Units.largeSpacing - bottom: statusBar.top + bottom: statusBarContainer.top left: newMailButton.left right: parent.right } } Item { - id: statusBar + id: statusBarContainer anchors { topMargin: Kube.Units.smallSpacing bottom: parent.bottom left: parent.left right: parent.right } - visible: false - - height: Kube.Units.gridUnit * 2 + height: childrenRect.height Rectangle { id: border + visible: statusBar.visible anchors { right: parent.right left: parent.left @@ -87,12 +86,13 @@ SplitView { opacity: 0.3 } Kube.StatusBar { + id: statusBar accountId: accountFolderview.currentAccount + height: Kube.Units.gridUnit * 2 anchors { top: border.bottom - left: statusBar.left - right: statusBar.right - bottom: statusBar.bottom + left: statusBarContainer.left + right: statusBarContainer.right } } } diff --git a/framework/qml/StatusBar.qml b/framework/qml/StatusBar.qml index ea2b4db5..35ef46a8 100644 --- a/framework/qml/StatusBar.qml +++ b/framework/qml/StatusBar.qml @@ -25,6 +25,7 @@ Item { property string currentFolderName: "" property string currentFolderId: "" property string errorText: "Error" + visible: false onCurrentFolderIdChanged: root.currentFolderName = "" Kube.FolderListModel { @@ -45,23 +46,22 @@ Item { 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: root; 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: root; visible: true } PropertyChanges { target: statusText; text: root.currentFolderName.length > 0 ? "Synchronizing " + root.currentFolderName: "Synchronizing..."; visible: true } PropertyChanges { target: progressBar; visible: true } }, State { name: "error"; when: model.status == Kube.AccountsModel.ErrorStatus - PropertyChanges { target: statusBar; visible: true } + PropertyChanges { target: root; visible: true } PropertyChanges { target: statusText; text: root.errorText; visible: true } } ] -- cgit v1.2.3