diff options
author | Michael Bohlender <michael.bohlender@kdemail.net> | 2017-04-21 13:05:40 +0200 |
---|---|---|
committer | Michael Bohlender <michael.bohlender@kdemail.net> | 2017-04-21 13:05:40 +0200 |
commit | 1f0bc11f4fe1fb96d25f88fc01c7300e700a82b8 (patch) | |
tree | b58e132f94789ec7744e6c4993307af39be914ce /components | |
parent | 4a04da5998ee2748659d54ea3a5781d167e66808 (diff) | |
download | kube-1f0bc11f4fe1fb96d25f88fc01c7300e700a82b8.tar.gz kube-1f0bc11f4fe1fb96d25f88fc01c7300e700a82b8.zip |
initial inline account switcher
Diffstat (limited to 'components')
-rw-r--r-- | components/kube/contents/ui/Kube.qml | 205 |
1 files changed, 47 insertions, 158 deletions
diff --git a/components/kube/contents/ui/Kube.qml b/components/kube/contents/ui/Kube.qml index ab80d188..2dbc58b0 100644 --- a/components/kube/contents/ui/Kube.qml +++ b/components/kube/contents/ui/Kube.qml | |||
@@ -101,7 +101,7 @@ Controls2.ApplicationWindow { | |||
101 | //Model | 101 | //Model |
102 | Kube.AccountsModel { | 102 | Kube.AccountsModel { |
103 | id: currentAccountModel | 103 | id: currentAccountModel |
104 | accountId: accountSwitcher.accountId | 104 | accountId: accountFolderview.accountId |
105 | } | 105 | } |
106 | 106 | ||
107 | //BEGIN Shortcuts | 107 | //BEGIN Shortcuts |
@@ -204,172 +204,61 @@ Controls2.ApplicationWindow { | |||
204 | } | 204 | } |
205 | } | 205 | } |
206 | 206 | ||
207 | Item { | 207 | Kube.InlineAccountSwitcher { |
208 | id: accountName | 208 | id: accountFolderview |
209 | |||
210 | Kube.FolderController { | ||
211 | id: accountNameFolderController | ||
212 | accountId: accountSwitcher.accountId | ||
213 | } | ||
214 | |||
215 | Menu { | ||
216 | id: contextMenu | ||
217 | title: "Edit" | ||
218 | |||
219 | MenuItem { | ||
220 | text: "Synchronize" | ||
221 | onTriggered: { | ||
222 | accountNameFolderController.synchronizeAction.execute() | ||
223 | } | ||
224 | } | ||
225 | } | ||
226 | 209 | ||
227 | anchors { | 210 | anchors { |
228 | top: newMailButton.bottom | 211 | top: newMailButton.bottom |
229 | topMargin: Kube.Units.smallSpacing | 212 | topMargin: Kube.Units.largeSpacing |
230 | left: parent.left | ||
231 | leftMargin: Kube.Units.largeSpacing | ||
232 | } | ||
233 | |||
234 | width: parent.width | ||
235 | height: Kube.Units.gridUnit * 2 | ||
236 | |||
237 | MouseArea { | ||
238 | anchors.fill: parent | ||
239 | acceptedButtons: Qt.RightButton | ||
240 | onClicked: { | ||
241 | contextMenu.popup() | ||
242 | } | ||
243 | } | ||
244 | |||
245 | Repeater { | ||
246 | model: currentAccountModel | ||
247 | Row { | ||
248 | spacing: Kube.Units.smallSpacing | ||
249 | anchors { | ||
250 | bottom: parent.bottom | ||
251 | left: parent.left | ||
252 | leftMargin: Kube.Units.smallSpacing | ||
253 | } | ||
254 | Layout.fillHeight: true | ||
255 | |||
256 | Kube.Label{ | ||
257 | text: model.name | ||
258 | font.weight: Font.Bold | ||
259 | color: Kube.Colors.highlightedTextColor | ||
260 | } | ||
261 | |||
262 | Kube.Icon { | ||
263 | id: statusIcon | ||
264 | visible: false | ||
265 | iconName: "" | ||
266 | states: [ | ||
267 | State { | ||
268 | name: "busy"; when: model.status == Kube.AccountsModel.BusyStatus | ||
269 | PropertyChanges { target: statusIcon; iconName: Kube.Icons.busy_inverted; visible: true } | ||
270 | }, | ||
271 | State { | ||
272 | name: "error"; when: model.status == Kube.AccountsModel.ErrorStatus | ||
273 | PropertyChanges { target: statusIcon; iconName: Kube.Icons.error_inverted; visible: true } | ||
274 | }, | ||
275 | State { | ||
276 | name: "checkmark"; when: model.status == Kube.AccountsModel.ConnectedStatus | ||
277 | PropertyChanges { target: statusIcon; iconName: Kube.Icons.connected_inverted; visible: true } | ||
278 | }, | ||
279 | State { | ||
280 | name: "disconnected"; when: model.status == Kube.AccountsModel.OfflineStatus | ||
281 | PropertyChanges { target: statusIcon; iconName: Kube.Icons.noNetworkConnection_inverted; visible: true } | ||
282 | } | ||
283 | ] | ||
284 | } | ||
285 | } | ||
286 | } | ||
287 | } | ||
288 | |||
289 | Kube.FolderListView { | ||
290 | id: folderListView | ||
291 | |||
292 | anchors { | ||
293 | top: accountName.bottom | ||
294 | topMargin: Kube.Units.smallSpacing | ||
295 | bottom: statusBar.top | ||
296 | left: parent.left | ||
297 | right: parent.right | ||
298 | leftMargin: Kube.Units.largeSpacing | ||
299 | } | ||
300 | |||
301 | focus: true | ||
302 | accountId: accountSwitcher.accountId | ||
303 | } | ||
304 | |||
305 | Item { | ||
306 | id: statusBar | ||
307 | anchors { | ||
308 | topMargin: Kube.Units.smallSpacing | ||
309 | bottom: outbox.top | ||
310 | left: parent.left | ||
311 | right: parent.right | ||
312 | } | ||
313 | |||
314 | height: Kube.Units.gridUnit | ||
315 | |||
316 | Repeater { | ||
317 | model: currentAccountModel | ||
318 | Kube.Label { | ||
319 | id: statusText | ||
320 | anchors.centerIn: parent | ||
321 | visible: false | ||
322 | color: Kube.Colors.highlightedTextColor | ||
323 | states: [ | ||
324 | State { | ||
325 | name: "disconnected"; when: model.status == Kube.AccountsModel.OfflineStatus | ||
326 | PropertyChanges { target: statusText; text: "Offline"; visible: true } | ||
327 | } | ||
328 | ] | ||
329 | } | ||
330 | } | ||
331 | } | ||
332 | |||
333 | Kube.Outbox { | ||
334 | id: outbox | ||
335 | |||
336 | anchors { | ||
337 | bottom: toolBar.top | ||
338 | left: parent.left | ||
339 | right: parent.right | ||
340 | } | ||
341 | height: Kube.Units.gridUnit * 1.5 | ||
342 | } | ||
343 | |||
344 | |||
345 | Item { | ||
346 | id: toolBar | ||
347 | |||
348 | anchors { | ||
349 | bottom: parent.bottom | 213 | bottom: parent.bottom |
350 | left: parent.left | 214 | left: newMailButton.left |
351 | right: parent.right | 215 | right: parent.right |
352 | } | 216 | } |
353 | height: Kube.Units.gridUnit * 2 | ||
354 | |||
355 | RowLayout { | ||
356 | anchors.centerIn: parent | ||
357 | |||
358 | spacing: Kube.Units.largeSpacing | ||
359 | |||
360 | Kube.AccountSwitcher { | ||
361 | id: accountSwitcher | ||
362 | iconName: Kube.Icons.menu_inverted | ||
363 | height: Kube.Units.gridUnit * 1.5 | ||
364 | width: height | ||
365 | } | ||
366 | } | ||
367 | } | 217 | } |
368 | } | 218 | } |
219 | //TODO bring back status bar and outbox | ||
220 | // Item { | ||
221 | // id: statusBar | ||
222 | // anchors { | ||
223 | // topMargin: Kube.Units.smallSpacing | ||
224 | // bottom: outbox.top | ||
225 | // left: parent.left | ||
226 | // right: parent.right | ||
227 | // } | ||
228 | // | ||
229 | // height: Kube.Units.gridUnit | ||
230 | // | ||
231 | // Repeater { | ||
232 | // model: currentAccountModel | ||
233 | // Kube.Label { | ||
234 | // id: statusText | ||
235 | // anchors.centerIn: parent | ||
236 | // visible: false | ||
237 | // color: Kube.Colors.highlightedTextColor | ||
238 | // states: [ | ||
239 | // State { | ||
240 | // name: "disconnected"; when: model.status == Kube.AccountsModel.OfflineStatus | ||
241 | // PropertyChanges { target: statusText; text: "Offline"; visible: true } | ||
242 | // } | ||
243 | // ] | ||
244 | // } | ||
245 | // } | ||
246 | // } | ||
247 | // | ||
248 | // Kube.Outbox { | ||
249 | // id: outbox | ||
250 | // | ||
251 | // anchors { | ||
252 | // bottom: toolBar.top | ||
253 | // left: parent.left | ||
254 | // right: parent.right | ||
255 | // } | ||
256 | // height: Kube.Units.gridUnit * 1.5 | ||
257 | // } | ||
369 | 258 | ||
370 | Kube.MailListView { | 259 | Kube.MailListView { |
371 | id: mailListView | 260 | id: mailListView |
372 | parentFolder: folderListView.currentFolder | 261 | parentFolder: accountFolderview.currentFolder |
373 | width: Kube.Units.gridUnit * 20 | 262 | width: Kube.Units.gridUnit * 20 |
374 | height: parent.height | 263 | height: parent.height |
375 | Layout.maximumWidth: app.width * 0.4 | 264 | Layout.maximumWidth: app.width * 0.4 |
@@ -381,8 +270,8 @@ Controls2.ApplicationWindow { | |||
381 | id: mailView | 270 | id: mailView |
382 | mail: mailListView.currentMail | 271 | mail: mailListView.currentMail |
383 | Layout.fillWidth: true | 272 | Layout.fillWidth: true |
384 | hideTrash: !folderListView.isTrashFolder | 273 | hideTrash: !accountFolderview.isTrashFolder |
385 | hideNonTrash: folderListView.isTrashFolder | 274 | hideNonTrash: accountFolderview.isTrashFolder |
386 | } | 275 | } |
387 | } | 276 | } |
388 | } | 277 | } |