summaryrefslogtreecommitdiffstats
path: root/components/mail/contents/ui/Mail.qml
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2017-04-05 13:00:21 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2017-04-05 13:00:21 +0200
commit5755ad47145d2985ba74354961b4127d82c516f6 (patch)
treeaa6af562b7e587be895ff5a4355270f82f3ea180 /components/mail/contents/ui/Mail.qml
parente78224a7d9ccf70aadde8c0bff1cab72e8cb7438 (diff)
downloadkube-5755ad47145d2985ba74354961b4127d82c516f6.tar.gz
kube-5755ad47145d2985ba74354961b4127d82c516f6.zip
A single framework plugin
Diffstat (limited to 'components/mail/contents/ui/Mail.qml')
-rw-r--r--components/mail/contents/ui/Mail.qml116
1 files changed, 55 insertions, 61 deletions
diff --git a/components/mail/contents/ui/Mail.qml b/components/mail/contents/ui/Mail.qml
index c7491d36..7cabf9a9 100644
--- a/components/mail/contents/ui/Mail.qml
+++ b/components/mail/contents/ui/Mail.qml
@@ -23,14 +23,8 @@ import QtQuick.Layouts 1.1
23 23
24import QtQuick.Controls 2.0 as Controls2 24import QtQuick.Controls 2.0 as Controls2
25 25
26import org.kube.framework.actions 1.0 as KubeAction 26import org.kube.framework 1.0 as Kube
27import org.kube.framework.settings 1.0 as KubeSettings
28import org.kube.framework.domain 1.0 as KubeFramework
29import org.kube.framework.notifications 1.0 as KubeNotifications
30import org.kube.framework.accounts 1.0 as KubeAccountsFramework
31import org.kube.components 1.0 as KubeComponents
32import org.kube.components.accounts 1.0 as KubeAccounts 27import org.kube.components.accounts 1.0 as KubeAccounts
33import org.kube.components.theme 1.0 as KubeTheme
34 28
35Controls2.ApplicationWindow { 29Controls2.ApplicationWindow {
36 id: app 30 id: app
@@ -42,11 +36,11 @@ Controls2.ApplicationWindow {
42 36
43 visible: true 37 visible: true
44 38
45 KubeNotifications.NotificationHandler { 39 Kube.NotificationHandler {
46 id: notificationHandler 40 id: notificationHandler
47 function handler(n) { 41 function handler(n) {
48 console.warn("We got a notification: ", n.message) 42 console.warn("We got a notification: ", n.message)
49 if (n.type == KubeNotifications.Notification.Warning) { 43 if (n.type == Kube.Notification.Warning) {
50 console.warn("And it's a warning!", n.type) 44 console.warn("And it's a warning!", n.type)
51 } 45 }
52 notificationPopup.notify(n.message); 46 notificationPopup.notify(n.message);
@@ -54,7 +48,7 @@ Controls2.ApplicationWindow {
54 } 48 }
55 49
56 //BEGIN Actions 50 //BEGIN Actions
57 KubeAction.Context { 51 Kube.Context {
58 id: maillistcontext 52 id: maillistcontext
59 property variant mail 53 property variant mail
60 property bool isDraft 54 property bool isDraft
@@ -62,7 +56,7 @@ Controls2.ApplicationWindow {
62 isDraft: mailListView.isDraft 56 isDraft: mailListView.isDraft
63 } 57 }
64 58
65 KubeAction.Action { 59 Kube.Action {
66 id: replyAction 60 id: replyAction
67 actionId: "org.kde.kube.actions.reply" 61 actionId: "org.kde.kube.actions.reply"
68 context: maillistcontext 62 context: maillistcontext
@@ -70,7 +64,7 @@ Controls2.ApplicationWindow {
70 //END Actions 64 //END Actions
71 65
72 //BEGIN ActionHandler 66 //BEGIN ActionHandler
73 KubeAction.ActionHandler { 67 Kube.ActionHandler {
74 actionId: "org.kde.kube.actions.reply" 68 actionId: "org.kde.kube.actions.reply"
75 function isReady(context) { 69 function isReady(context) {
76 return context.mail ? true : false; 70 return context.mail ? true : false;
@@ -82,7 +76,7 @@ Controls2.ApplicationWindow {
82 } 76 }
83 } 77 }
84 78
85 KubeAction.ActionHandler { 79 Kube.ActionHandler {
86 actionId: "org.kde.kube.actions.edit" 80 actionId: "org.kde.kube.actions.edit"
87 function isReady(context) { 81 function isReady(context) {
88 return context.mail && context.isDraft; 82 return context.mail && context.isDraft;
@@ -95,7 +89,7 @@ Controls2.ApplicationWindow {
95 //END ActionHandler 89 //END ActionHandler
96 90
97 //Controller 91 //Controller
98 KubeFramework.MailController { 92 Kube.MailController {
99 id: mailController 93 id: mailController
100 Binding on threadLeader { 94 Binding on threadLeader {
101 //!! checks for the availability of the type 95 //!! checks for the availability of the type
@@ -104,7 +98,7 @@ Controls2.ApplicationWindow {
104 } 98 }
105 } 99 }
106 100
107 KubeFramework.FolderController { 101 Kube.FolderController {
108 id: folderController 102 id: folderController
109 Binding on folder { 103 Binding on folder {
110 //!! checks for the availability of the type 104 //!! checks for the availability of the type
@@ -114,7 +108,7 @@ Controls2.ApplicationWindow {
114 } 108 }
115 109
116 //Model 110 //Model
117 KubeAccountsFramework.AccountsModel { 111 Kube.AccountsModel {
118 id: currentAccountModel 112 id: currentAccountModel
119 accountId: accountSwitcher.accountId 113 accountId: accountSwitcher.accountId
120 } 114 }
@@ -144,7 +138,7 @@ Controls2.ApplicationWindow {
144 Rectangle { 138 Rectangle {
145 anchors.fill: parent 139 anchors.fill: parent
146 140
147 color: KubeTheme.Colors.backgroundColor 141 color: Kube.Colors.backgroundColor
148 } 142 }
149 //END background 143 //END background
150 144
@@ -159,11 +153,11 @@ Controls2.ApplicationWindow {
159 width: app.width 153 width: app.width
160 154
161 Rectangle { 155 Rectangle {
162 width: KubeTheme.Units.gridUnit * 10 156 width: Kube.Units.gridUnit * 10
163 Layout.maximumWidth: app.width * 0.25 157 Layout.maximumWidth: app.width * 0.25
164 Layout.minimumWidth: KubeTheme.Units.gridUnit * 5 158 Layout.minimumWidth: Kube.Units.gridUnit * 5
165 159
166 color: KubeTheme.Colors.textColor 160 color: Kube.Colors.textColor
167 161
168 Controls2.ToolBar { 162 Controls2.ToolBar {
169 id: toolBar 163 id: toolBar
@@ -177,18 +171,18 @@ Controls2.ApplicationWindow {
177 RowLayout { 171 RowLayout {
178 anchors.centerIn: parent 172 anchors.centerIn: parent
179 173
180 spacing: KubeTheme.Units.largeSpacing 174 spacing: Kube.Units.largeSpacing
181 175
182 KubeComponents.AccountSwitcher { 176 Kube.AccountSwitcher {
183 id: accountSwitcher 177 id: accountSwitcher
184 iconName: KubeTheme.Icons.menu 178 iconName: Kube.Icons.menu
185 height: KubeTheme.Units.gridUnit * 1.5 179 height: Kube.Units.gridUnit * 1.5
186 width: height 180 width: height
187 } 181 }
188 182
189 ToolButton { 183 ToolButton {
190 iconName: KubeTheme.Icons.user 184 iconName: Kube.Icons.user
191 height: KubeTheme.Units.gridUnit * 1.5 185 height: Kube.Units.gridUnit * 1.5
192 width: height 186 width: height
193 187
194 onClicked: { 188 onClicked: {
@@ -197,8 +191,8 @@ Controls2.ApplicationWindow {
197 } 191 }
198 192
199 ToolButton { 193 ToolButton {
200 iconName: KubeTheme.Icons.search 194 iconName: Kube.Icons.search
201 height: KubeTheme.Units.gridUnit * 1.5 195 height: Kube.Units.gridUnit * 1.5
202 width: height 196 width: height
203 197
204 onClicked: { 198 onClicked: {
@@ -208,14 +202,14 @@ Controls2.ApplicationWindow {
208 } 202 }
209 } 203 }
210 204
211 KubeComponents.PositiveButton { 205 Kube.PositiveButton {
212 id: newMailButton 206 id: newMailButton
213 207
214 anchors { 208 anchors {
215 top: toolBar.bottom 209 top: toolBar.bottom
216 left: parent.left 210 left: parent.left
217 right: parent.right 211 right: parent.right
218 margins: KubeTheme.Units.largeSpacing 212 margins: Kube.Units.largeSpacing
219 } 213 }
220 214
221 text: qsTr("New Email") 215 text: qsTr("New Email")
@@ -228,7 +222,7 @@ Controls2.ApplicationWindow {
228 Item { 222 Item {
229 id: accountName 223 id: accountName
230 224
231 KubeFramework.FolderController { 225 Kube.FolderController {
232 id: accountNameFolderController 226 id: accountNameFolderController
233 accountId: accountSwitcher.accountId 227 accountId: accountSwitcher.accountId
234 } 228 }
@@ -247,11 +241,11 @@ Controls2.ApplicationWindow {
247 241
248 anchors { 242 anchors {
249 top: newMailButton.bottom 243 top: newMailButton.bottom
250 topMargin: KubeTheme.Units.smallSpacing 244 topMargin: Kube.Units.smallSpacing
251 } 245 }
252 246
253 width: parent.width 247 width: parent.width
254 height: KubeTheme.Units.gridUnit * 2 248 height: Kube.Units.gridUnit * 2
255 249
256 MouseArea { 250 MouseArea {
257 anchors.fill: parent 251 anchors.fill: parent
@@ -264,40 +258,40 @@ Controls2.ApplicationWindow {
264 Repeater { 258 Repeater {
265 model: currentAccountModel 259 model: currentAccountModel
266 Row { 260 Row {
267 spacing: KubeTheme.Units.smallSpacing 261 spacing: Kube.Units.smallSpacing
268 anchors { 262 anchors {
269 bottom: parent.bottom 263 bottom: parent.bottom
270 left: parent.left 264 left: parent.left
271 leftMargin: KubeTheme.Units.smallSpacing 265 leftMargin: Kube.Units.smallSpacing
272 } 266 }
273 Layout.fillHeight: true 267 Layout.fillHeight: true
274 268
275 Text { 269 Text {
276 text: model.name 270 text: model.name
277 font.weight: Font.DemiBold 271 font.weight: Font.DemiBold
278 color: KubeTheme.Colors.highlightedTextColor 272 color: Kube.Colors.highlightedTextColor
279 } 273 }
280 274
281 KubeComponents.Icon { 275 Kube.Icon {
282 id: statusIcon 276 id: statusIcon
283 visible: false 277 visible: false
284 iconName: "" 278 iconName: ""
285 states: [ 279 states: [
286 State { 280 State {
287 name: "busy"; when: model.status == KubeAccountsFramework.AccountsModel.BusyStatus 281 name: "busy"; when: model.status == Kube.AccountsModel.BusyStatus
288 PropertyChanges { target: statusIcon; iconName: KubeTheme.Icons.busy; visible: true } 282 PropertyChanges { target: statusIcon; iconName: Kube.Icons.busy; visible: true }
289 }, 283 },
290 State { 284 State {
291 name: "error"; when: model.status == KubeAccountsFramework.AccountsModel.ErrorStatus 285 name: "error"; when: model.status == Kube.AccountsModel.ErrorStatus
292 PropertyChanges { target: statusIcon; iconName: KubeTheme.Icons.error; visible: true } 286 PropertyChanges { target: statusIcon; iconName: Kube.Icons.error; visible: true }
293 }, 287 },
294 State { 288 State {
295 name: "checkmark"; when: model.status == KubeAccountsFramework.AccountsModel.ConnectedStatus 289 name: "checkmark"; when: model.status == Kube.AccountsModel.ConnectedStatus
296 PropertyChanges { target: statusIcon; iconName: KubeTheme.Icons.connected; visible: true } 290 PropertyChanges { target: statusIcon; iconName: Kube.Icons.connected; visible: true }
297 }, 291 },
298 State { 292 State {
299 name: "disconnected"; when: model.status == KubeAccountsFramework.AccountsModel.OfflineStatus 293 name: "disconnected"; when: model.status == Kube.AccountsModel.OfflineStatus
300 PropertyChanges { target: statusIcon; iconName: KubeTheme.Icons.noNetworkConnection; visible: true } 294 PropertyChanges { target: statusIcon; iconName: Kube.Icons.noNetworkConnection; visible: true }
301 } 295 }
302 ] 296 ]
303 } 297 }
@@ -305,12 +299,12 @@ Controls2.ApplicationWindow {
305 } 299 }
306 } 300 }
307 301
308 KubeComponents.FolderListView { 302 Kube.FolderListView {
309 id: folderListView 303 id: folderListView
310 304
311 anchors { 305 anchors {
312 top: accountName.bottom 306 top: accountName.bottom
313 topMargin: KubeTheme.Units.smallSpacing 307 topMargin: Kube.Units.smallSpacing
314 bottom: statusBar.top 308 bottom: statusBar.top
315 left: parent.left 309 left: parent.left
316 right: parent.right 310 right: parent.right
@@ -323,13 +317,13 @@ Controls2.ApplicationWindow {
323 Item { 317 Item {
324 id: statusBar 318 id: statusBar
325 anchors { 319 anchors {
326 topMargin: KubeTheme.Units.smallSpacing 320 topMargin: Kube.Units.smallSpacing
327 bottom: outbox.top 321 bottom: outbox.top
328 left: parent.left 322 left: parent.left
329 right: parent.right 323 right: parent.right
330 } 324 }
331 325
332 height: KubeTheme.Units.gridUnit 326 height: Kube.Units.gridUnit
333 327
334 Repeater { 328 Repeater {
335 model: currentAccountModel 329 model: currentAccountModel
@@ -337,10 +331,10 @@ Controls2.ApplicationWindow {
337 id: statusText 331 id: statusText
338 anchors.centerIn: parent 332 anchors.centerIn: parent
339 visible: false 333 visible: false
340 color: KubeTheme.Colors.highlightedTextColor 334 color: Kube.Colors.highlightedTextColor
341 states: [ 335 states: [
342 State { 336 State {
343 name: "disconnected"; when: model.status == KubeAccountsFramework.AccountsModel.OfflineStatus 337 name: "disconnected"; when: model.status == Kube.AccountsModel.OfflineStatus
344 PropertyChanges { target: statusText; text: "Offline"; visible: true } 338 PropertyChanges { target: statusText; text: "Offline"; visible: true }
345 } 339 }
346 ] 340 ]
@@ -348,7 +342,7 @@ Controls2.ApplicationWindow {
348 } 342 }
349 } 343 }
350 344
351 KubeComponents.Outbox { 345 Kube.Outbox {
352 id: outbox 346 id: outbox
353 347
354 anchors { 348 anchors {
@@ -356,21 +350,21 @@ Controls2.ApplicationWindow {
356 left: parent.left 350 left: parent.left
357 right: parent.right 351 right: parent.right
358 } 352 }
359 height: KubeTheme.Units.gridUnit * 1.5 353 height: Kube.Units.gridUnit * 1.5
360 } 354 }
361 } 355 }
362 356
363 KubeComponents.MailListView { 357 Kube.MailListView {
364 id: mailListView 358 id: mailListView
365 parentFolder: folderListView.currentFolder 359 parentFolder: folderListView.currentFolder
366 width: KubeTheme.Units.gridUnit * 20 360 width: Kube.Units.gridUnit * 20
367 height: parent.height 361 height: parent.height
368 Layout.maximumWidth: app.width * 0.4 362 Layout.maximumWidth: app.width * 0.4
369 Layout.minimumWidth: KubeTheme.Units.gridUnit * 10 363 Layout.minimumWidth: Kube.Units.gridUnit * 10
370 focus: true 364 focus: true
371 } 365 }
372 366
373 KubeComponents.ConversationView { 367 Kube.ConversationView {
374 id: mailView 368 id: mailView
375 mail: mailListView.currentMail 369 mail: mailListView.currentMail
376 Layout.fillWidth: true 370 Layout.fillWidth: true
@@ -379,7 +373,7 @@ Controls2.ApplicationWindow {
379 //END Main content 373 //END Main content
380 374
381 //BEGIN Composer 375 //BEGIN Composer
382 KubeComponents.FocusComposer { 376 Kube.FocusComposer {
383 id: composer 377 id: composer
384 378
385 height: app.height * 0.85 379 height: app.height * 0.85
@@ -403,7 +397,7 @@ Controls2.ApplicationWindow {
403 //END AccountWizard 397 //END AccountWizard
404 398
405 //BEGIN Notification 399 //BEGIN Notification
406 KubeComponents.Notification { 400 Kube.NotificationPopup {
407 id: notificationPopup 401 id: notificationPopup
408 402
409 anchors { 403 anchors {
@@ -418,7 +412,7 @@ Controls2.ApplicationWindow {
418 id: search 412 id: search
419 413
420 width: app.width * 0.6 414 width: app.width * 0.6
421 height: KubeTheme.Units.gridUnit * 3 415 height: Kube.Units.gridUnit * 3
422 416
423 x: app.width * 0.2 417 x: app.width * 0.2
424 y: app.height * 0.2 418 y: app.height * 0.2
@@ -447,7 +441,7 @@ Controls2.ApplicationWindow {
447 //END Search 441 //END Search
448 442
449 //BEGIN People 443 //BEGIN People
450 KubeComponents.People { 444 Kube.People {
451 id: people 445 id: people
452 446
453 height: app.height * 0.85 447 height: app.height * 0.85