summaryrefslogtreecommitdiffstats
path: root/components
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2017-05-04 16:18:32 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2017-05-04 16:22:39 +0200
commit2c6f63415a5fd5f7b90b4f32a88e8c8da20e1825 (patch)
treeada2bac172326fb00cdd85525cdf0752cbb0aafd /components
parent322a616573dfe52ee412573bd93fbc646b4ca008 (diff)
downloadkube-2c6f63415a5fd5f7b90b4f32a88e8c8da20e1825.tar.gz
kube-2c6f63415a5fd5f7b90b4f32a88e8c8da20e1825.zip
Added a progress bar to the statusbar
Consider this an experiment. While I find the progress indicator already useful for longer operations it should probably be more context sensitive and the current location clashes with the inline account switcher (it looks a bit as if the statusbar belonged to the account on the bottom).
Diffstat (limited to 'components')
-rw-r--r--components/kube/contents/ui/MailView.qml66
1 files changed, 54 insertions, 12 deletions
diff --git a/components/kube/contents/ui/MailView.qml b/components/kube/contents/ui/MailView.qml
index 63a58dd6..01651dcf 100644
--- a/components/kube/contents/ui/MailView.qml
+++ b/components/kube/contents/ui/MailView.qml
@@ -20,6 +20,7 @@
20 20
21import QtQuick 2.7 21import QtQuick 2.7
22import QtQuick.Controls 1.3 22import QtQuick.Controls 1.3
23import QtQuick.Controls 2.0 as Controls2
23import QtQuick.Layouts 1.1 24import QtQuick.Layouts 1.1
24 25
25import org.kube.framework 1.0 as Kube 26import org.kube.framework 1.0 as Kube
@@ -71,24 +72,65 @@ SplitView {
71 right: parent.right 72 right: parent.right
72 } 73 }
73 74
74 height: Kube.Units.gridUnit 75 height: Kube.Units.gridUnit * 2
75 76
76 Repeater { 77 Repeater {
77 model: Kube.AccountsModel { 78 model: Kube.AccountsModel {
78 accountId: accountFolderview.accountId 79 accountId: accountFolderview.currentAccount
79 } 80 }
80 81
81 Kube.Label { 82 Column {
82 id: statusText 83 anchors.fill: statusBar
83 anchors.centerIn: parent 84 spacing: Kube.Units.smallSpacing
84 visible: false 85 Kube.Label {
85 color: Kube.Colors.highlightedTextColor 86 id: statusText
86 states: [ 87 anchors.horizontalCenter: parent.horizontalCenter
87 State { 88 visible: false
88 name: "disconnected"; when: model.status == Kube.AccountsModel.OfflineStatus 89 color: Kube.Colors.highlightedTextColor
89 PropertyChanges { target: statusText; text: "Offline"; visible: true } 90 states: [
91 State {
92 name: "disconnected"; when: model.status == Kube.AccountsModel.OfflineStatus
93 PropertyChanges { target: statusText; text: "Offline"; visible: true }
94 },
95 State {
96 name: "busy"; when: model.status == Kube.AccountsModel.BusyStatus
97 PropertyChanges { target: statusText; text: "Busy"; visible: true }
98 PropertyChanges { target: progressBar; visible: true }
99 }
100 ]
101 }
102 Controls2.ProgressBar {
103 id: progressBar
104 indeterminate: true
105 visible: false
106 height: Kube.Units.smallSpacing
107 width: parent.width
108
109 background: Rectangle {
110 color: Kube.Colors.backgroundColor
111 radius: 3
112 }
113
114 contentItem: Item {
115 Rectangle {
116 width: control.visualPosition * parent.width
117 height: parent.height
118 radius: 2
119 color: Kube.Colors.highlightColor
120 }
121 }
122
123
124 Kube.Listener {
125 filter: Kube.Messages.progressNotification
126 onMessageReceived: {
127 progressBar.indeterminate = false
128 progressBar.from = 0
129 progressBar.to = message.total
130 progressBar.value = message.progress
131 }
132 }
90 } 133 }
91 ]
92 } 134 }
93 } 135 }
94 } 136 }