diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-04-05 13:00:21 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-04-05 13:00:21 +0200 |
commit | 5755ad47145d2985ba74354961b4127d82c516f6 (patch) | |
tree | aa6af562b7e587be895ff5a4355270f82f3ea180 /framework/qml/ConversationView.qml | |
parent | e78224a7d9ccf70aadde8c0bff1cab72e8cb7438 (diff) | |
download | kube-5755ad47145d2985ba74354961b4127d82c516f6.tar.gz kube-5755ad47145d2985ba74354961b4127d82c516f6.zip |
A single framework plugin
Diffstat (limited to 'framework/qml/ConversationView.qml')
-rw-r--r-- | framework/qml/ConversationView.qml | 116 |
1 files changed, 57 insertions, 59 deletions
diff --git a/framework/qml/ConversationView.qml b/framework/qml/ConversationView.qml index 4196ebbd..fc940e39 100644 --- a/framework/qml/ConversationView.qml +++ b/framework/qml/ConversationView.qml | |||
@@ -21,13 +21,11 @@ import QtQuick.Controls 1.3 as Controls1 | |||
21 | import QtQuick.Controls 2 | 21 | import QtQuick.Controls 2 |
22 | import QtQuick.Layouts 1.1 | 22 | import QtQuick.Layouts 1.1 |
23 | import org.kde.kirigami 1.0 as Kirigami | 23 | import org.kde.kirigami 1.0 as Kirigami |
24 | import org.kube.framework 1.0 as Kube | ||
24 | 25 | ||
25 | import QtQml 2.2 as QtQml | 26 | import QtQml 2.2 as QtQml |
26 | 27 | ||
27 | import org.kube.framework.domain 1.0 as KubeFramework | ||
28 | import org.kube.framework.actions 1.0 as KubeAction | ||
29 | 28 | ||
30 | import org.kube.components.theme 1.0 as KubeTheme | ||
31 | 29 | ||
32 | Rectangle { | 30 | Rectangle { |
33 | id: root | 31 | id: root |
@@ -44,7 +42,7 @@ Rectangle { | |||
44 | currentMail = null; | 42 | currentMail = null; |
45 | } | 43 | } |
46 | 44 | ||
47 | color: KubeTheme.Colors.backgroundColor | 45 | color: Kube.Colors.backgroundColor |
48 | 46 | ||
49 | ListView { | 47 | ListView { |
50 | id: listView | 48 | id: listView |
@@ -79,18 +77,18 @@ Rectangle { | |||
79 | 77 | ||
80 | clip: true | 78 | clip: true |
81 | 79 | ||
82 | model: KubeFramework.MailListModel { | 80 | model: Kube.MailListModel { |
83 | mail: root.mail | 81 | mail: root.mail |
84 | } | 82 | } |
85 | 83 | ||
86 | header: Item { | 84 | header: Item { |
87 | height: KubeTheme.Units.gridUnit * 0.5 | 85 | height: Kube.Units.gridUnit * 0.5 |
88 | width: parent.width | 86 | width: parent.width |
89 | 87 | ||
90 | } | 88 | } |
91 | 89 | ||
92 | footer: Item { | 90 | footer: Item { |
93 | height: KubeTheme.Units.gridUnit | 91 | height: Kube.Units.gridUnit |
94 | width: parent.width | 92 | width: parent.width |
95 | } | 93 | } |
96 | 94 | ||
@@ -144,7 +142,7 @@ Rectangle { | |||
144 | //which will break lot's of things. | 142 | //which will break lot's of things. |
145 | cacheBuffer: 100000 | 143 | cacheBuffer: 100000 |
146 | 144 | ||
147 | KubeFramework.MailController { | 145 | Kube.MailController { |
148 | id: mailController | 146 | id: mailController |
149 | Binding on mail { | 147 | Binding on mail { |
150 | //!! checks for the availability of the type | 148 | //!! checks for the availability of the type |
@@ -167,7 +165,7 @@ Rectangle { | |||
167 | 165 | ||
168 | //Intercept all scroll events, | 166 | //Intercept all scroll events, |
169 | //necessary due to the webengineview | 167 | //necessary due to the webengineview |
170 | KubeFramework.MouseProxy { | 168 | Kube.MouseProxy { |
171 | anchors.fill: parent | 169 | anchors.fill: parent |
172 | target: listView | 170 | target: listView |
173 | forwardWheelEvents: true | 171 | forwardWheelEvents: true |
@@ -185,14 +183,14 @@ Rectangle { | |||
185 | } | 183 | } |
186 | } | 184 | } |
187 | 185 | ||
188 | height: sheet.height + KubeTheme.Units.gridUnit | 186 | height: sheet.height + Kube.Units.gridUnit |
189 | width: parent.width | 187 | width: parent.width |
190 | 188 | ||
191 | Rectangle { | 189 | Rectangle { |
192 | id: sheet | 190 | id: sheet |
193 | anchors.centerIn: parent | 191 | anchors.centerIn: parent |
194 | implicitHeight: header.height + attachments.height + body.height + incompleteBody.height + footer.height + KubeTheme.Units.largeSpacing | 192 | implicitHeight: header.height + attachments.height + body.height + incompleteBody.height + footer.height + Kube.Units.largeSpacing |
195 | width: parent.width - KubeTheme.Units.gridUnit * 2 | 193 | width: parent.width - Kube.Units.gridUnit * 2 |
196 | 194 | ||
197 | //Overlay for non-active mails | 195 | //Overlay for non-active mails |
198 | Rectangle { | 196 | Rectangle { |
@@ -203,7 +201,7 @@ Rectangle { | |||
203 | opacity: 0.2 | 201 | opacity: 0.2 |
204 | } | 202 | } |
205 | 203 | ||
206 | color: KubeTheme.Colors.viewBackgroundColor | 204 | color: Kube.Colors.viewBackgroundColor |
207 | 205 | ||
208 | //BEGIN header | 206 | //BEGIN header |
209 | Item { | 207 | Item { |
@@ -213,10 +211,10 @@ Rectangle { | |||
213 | top: parent.top | 211 | top: parent.top |
214 | left: parent.left | 212 | left: parent.left |
215 | right: parent.right | 213 | right: parent.right |
216 | margins: KubeTheme.Units.largeSpacing | 214 | margins: Kube.Units.largeSpacing |
217 | } | 215 | } |
218 | 216 | ||
219 | height: headerContent.height + KubeTheme.Units.smallSpacing | 217 | height: headerContent.height + Kube.Units.smallSpacing |
220 | 218 | ||
221 | states: [ | 219 | states: [ |
222 | State { | 220 | State { |
@@ -250,7 +248,7 @@ Rectangle { | |||
250 | text: Qt.formatDateTime(model.date, "dd MMM yyyy hh:mm") | 248 | text: Qt.formatDateTime(model.date, "dd MMM yyyy hh:mm") |
251 | 249 | ||
252 | font.pointSize: Kirigami.Theme.defaultFont.pointSize * 0.7 | 250 | font.pointSize: Kirigami.Theme.defaultFont.pointSize * 0.7 |
253 | color: KubeTheme.Colors.textColor | 251 | color: Kube.Colors.textColor |
254 | opacity: 0.75 | 252 | opacity: 0.75 |
255 | } | 253 | } |
256 | 254 | ||
@@ -262,7 +260,7 @@ Rectangle { | |||
262 | horizontalCenter: parent.horizontalCenter | 260 | horizontalCenter: parent.horizontalCenter |
263 | } | 261 | } |
264 | 262 | ||
265 | //spacing: KubeTheme.Units.smallSpacing | 263 | //spacing: Kube.Units.smallSpacing |
266 | 264 | ||
267 | width: parent.width | 265 | width: parent.width |
268 | 266 | ||
@@ -271,7 +269,7 @@ Rectangle { | |||
271 | 269 | ||
272 | width: parent.width | 270 | width: parent.width |
273 | 271 | ||
274 | spacing: KubeTheme.Units.smallSpacing | 272 | spacing: Kube.Units.smallSpacing |
275 | clip: true | 273 | clip: true |
276 | 274 | ||
277 | Text { | 275 | Text { |
@@ -280,7 +278,7 @@ Rectangle { | |||
280 | text: model.senderName | 278 | text: model.senderName |
281 | 279 | ||
282 | font.weight: Font.DemiBold | 280 | font.weight: Font.DemiBold |
283 | color: KubeTheme.Colors.textColor | 281 | color: Kube.Colors.textColor |
284 | opacity: 0.75 | 282 | opacity: 0.75 |
285 | } | 283 | } |
286 | 284 | ||
@@ -288,10 +286,10 @@ Rectangle { | |||
288 | 286 | ||
289 | text: model.sender | 287 | text: model.sender |
290 | 288 | ||
291 | width: parent.width - senderName.width - date_label.width - KubeTheme.Units.largeSpacing | 289 | width: parent.width - senderName.width - date_label.width - Kube.Units.largeSpacing |
292 | elide: Text.ElideRight | 290 | elide: Text.ElideRight |
293 | 291 | ||
294 | color: KubeTheme.Colors.textColor | 292 | color: Kube.Colors.textColor |
295 | opacity: 0.75 | 293 | opacity: 0.75 |
296 | 294 | ||
297 | clip: true | 295 | clip: true |
@@ -307,7 +305,7 @@ Rectangle { | |||
307 | 305 | ||
308 | elide: Text.ElideRight | 306 | elide: Text.ElideRight |
309 | 307 | ||
310 | color: KubeTheme.Colors.textColor | 308 | color: Kube.Colors.textColor |
311 | opacity: 0.75 | 309 | opacity: 0.75 |
312 | font.italic: true | 310 | font.italic: true |
313 | } | 311 | } |
@@ -315,49 +313,49 @@ Rectangle { | |||
315 | Text { | 313 | Text { |
316 | id: recipients | 314 | id: recipients |
317 | 315 | ||
318 | width: parent.width - goDown.width - KubeTheme.Units.smallSpacing | 316 | width: parent.width - goDown.width - Kube.Units.smallSpacing |
319 | 317 | ||
320 | text:"to: "+ model.to + " " + model.cc + " " + model.bcc | 318 | text:"to: "+ model.to + " " + model.cc + " " + model.bcc |
321 | 319 | ||
322 | elide: Text.ElideRight | 320 | elide: Text.ElideRight |
323 | 321 | ||
324 | color: KubeTheme.Colors.textColor | 322 | color: Kube.Colors.textColor |
325 | opacity: 0.75 | 323 | opacity: 0.75 |
326 | } | 324 | } |
327 | 325 | ||
328 | Text { | 326 | Text { |
329 | id: to | 327 | id: to |
330 | 328 | ||
331 | width: parent.width - goDown.width - KubeTheme.Units.smallSpacing | 329 | width: parent.width - goDown.width - Kube.Units.smallSpacing |
332 | 330 | ||
333 | text:"to: " + model.to | 331 | text:"to: " + model.to |
334 | 332 | ||
335 | wrapMode: Text.WordWrap | 333 | wrapMode: Text.WordWrap |
336 | color: KubeTheme.Colors.textColor | 334 | color: Kube.Colors.textColor |
337 | opacity: 0.75 | 335 | opacity: 0.75 |
338 | } | 336 | } |
339 | 337 | ||
340 | Text { | 338 | Text { |
341 | id: cc | 339 | id: cc |
342 | 340 | ||
343 | width: parent.width - goDown.width - KubeTheme.Units.smallSpacing | 341 | width: parent.width - goDown.width - Kube.Units.smallSpacing |
344 | 342 | ||
345 | text:"cc: " + model.cc | 343 | text:"cc: " + model.cc |
346 | 344 | ||
347 | wrapMode: Text.WordWrap | 345 | wrapMode: Text.WordWrap |
348 | color: KubeTheme.Colors.textColor | 346 | color: Kube.Colors.textColor |
349 | opacity: 0.75 | 347 | opacity: 0.75 |
350 | } | 348 | } |
351 | 349 | ||
352 | Text { | 350 | Text { |
353 | id: bcc | 351 | id: bcc |
354 | 352 | ||
355 | width: parent.width - goDown.width - KubeTheme.Units.smallSpacing | 353 | width: parent.width - goDown.width - Kube.Units.smallSpacing |
356 | 354 | ||
357 | text:"bcc: " + model.bcc | 355 | text:"bcc: " + model.bcc |
358 | 356 | ||
359 | wrapMode: Text.WordWrap | 357 | wrapMode: Text.WordWrap |
360 | color: KubeTheme.Colors.textColor | 358 | color: Kube.Colors.textColor |
361 | opacity: 0.75 | 359 | opacity: 0.75 |
362 | } | 360 | } |
363 | 361 | ||
@@ -369,15 +367,15 @@ Rectangle { | |||
369 | right: seperator.right | 367 | right: seperator.right |
370 | } | 368 | } |
371 | 369 | ||
372 | height: KubeTheme.Units.gridUnit | 370 | height: Kube.Units.gridUnit |
373 | width: height | 371 | width: height |
374 | 372 | ||
375 | color: KubeTheme.Colors.backgroundColor | 373 | color: Kube.Colors.backgroundColor |
376 | 374 | ||
377 | Controls1.ToolButton { | 375 | Controls1.ToolButton { |
378 | anchors.fill: parent | 376 | anchors.fill: parent |
379 | 377 | ||
380 | iconName: KubeTheme.Icons.goDown | 378 | iconName: Kube.Icons.goDown |
381 | } | 379 | } |
382 | } | 380 | } |
383 | 381 | ||
@@ -387,15 +385,15 @@ Rectangle { | |||
387 | right: seperator.right | 385 | right: seperator.right |
388 | } | 386 | } |
389 | 387 | ||
390 | height: KubeTheme.Units.gridUnit | 388 | height: Kube.Units.gridUnit |
391 | width: height | 389 | width: height |
392 | 390 | ||
393 | color: KubeTheme.Colors.backgroundColor | 391 | color: Kube.Colors.backgroundColor |
394 | 392 | ||
395 | Controls1.ToolButton { | 393 | Controls1.ToolButton { |
396 | anchors.fill: parent | 394 | anchors.fill: parent |
397 | 395 | ||
398 | iconName: header.state === "details" ? KubeTheme.Icons.goUp : KubeTheme.Icons.goDown | 396 | iconName: header.state === "details" ? Kube.Icons.goUp : Kube.Icons.goDown |
399 | 397 | ||
400 | onClicked: { | 398 | onClicked: { |
401 | header.state === "details" ? header.state = "small" : header.state = "details" | 399 | header.state === "details" ? header.state = "small" : header.state = "details" |
@@ -414,7 +412,7 @@ Rectangle { | |||
414 | 412 | ||
415 | height: 1 | 413 | height: 1 |
416 | 414 | ||
417 | color: KubeTheme.Colors.textColor | 415 | color: Kube.Colors.textColor |
418 | opacity: 0.5 | 416 | opacity: 0.5 |
419 | } | 417 | } |
420 | } | 418 | } |
@@ -425,14 +423,14 @@ Rectangle { | |||
425 | 423 | ||
426 | anchors { | 424 | anchors { |
427 | top: header.bottom | 425 | top: header.bottom |
428 | topMargin: KubeTheme.Units.smallSpacing | 426 | topMargin: Kube.Units.smallSpacing |
429 | right: header.right | 427 | right: header.right |
430 | } | 428 | } |
431 | 429 | ||
432 | width: header.width - KubeTheme.Units.largeSpacing | 430 | width: header.width - Kube.Units.largeSpacing |
433 | 431 | ||
434 | layoutDirection: Qt.RightToLeft | 432 | layoutDirection: Qt.RightToLeft |
435 | spacing: KubeTheme.Units.smallSpacing | 433 | spacing: Kube.Units.smallSpacing |
436 | clip: true | 434 | clip: true |
437 | 435 | ||
438 | Repeater { | 436 | Repeater { |
@@ -456,12 +454,12 @@ Rectangle { | |||
456 | top: header.bottom | 454 | top: header.bottom |
457 | left: header.left | 455 | left: header.left |
458 | right: header.right | 456 | right: header.right |
459 | leftMargin: KubeTheme.Units.largeSpacing | 457 | leftMargin: Kube.Units.largeSpacing |
460 | rightMargin: KubeTheme.Units.largeSpacing | 458 | rightMargin: Kube.Units.largeSpacing |
461 | topMargin: Math.max(attachments.height, KubeTheme.Units.largeSpacing) | 459 | topMargin: Math.max(attachments.height, Kube.Units.largeSpacing) |
462 | } | 460 | } |
463 | 461 | ||
464 | width: header.width - KubeTheme.Units.largeSpacing * 2 | 462 | width: header.width - Kube.Units.largeSpacing * 2 |
465 | height: desiredHeight | 463 | height: desiredHeight |
466 | 464 | ||
467 | message: model.mimeMessage | 465 | message: model.mimeMessage |
@@ -474,21 +472,21 @@ Rectangle { | |||
474 | top: header.bottom | 472 | top: header.bottom |
475 | left: header.left | 473 | left: header.left |
476 | right: header.right | 474 | right: header.right |
477 | leftMargin: KubeTheme.Units.largeSpacing | 475 | leftMargin: Kube.Units.largeSpacing |
478 | rightMargin: KubeTheme.Units.largeSpacing | 476 | rightMargin: Kube.Units.largeSpacing |
479 | topMargin: Math.max(attachments.height, KubeTheme.Units.largeSpacing) | 477 | topMargin: Math.max(attachments.height, Kube.Units.largeSpacing) |
480 | } | 478 | } |
481 | visible: model.incomplete | 479 | visible: model.incomplete |
482 | text: "Incomplete body..." | 480 | text: "Incomplete body..." |
483 | color: KubeTheme.Colors.textColor | 481 | color: Kube.Colors.textColor |
484 | enabled: false | 482 | enabled: false |
485 | states: [ | 483 | states: [ |
486 | State { | 484 | State { |
487 | name: "inprogress"; when: model.status == KubeFramework.MailListModel.InProgressStatus | 485 | name: "inprogress"; when: model.status == Kube.MailListModel.InProgressStatus |
488 | PropertyChanges { target: incompleteBody; text: "Downloading message..." } | 486 | PropertyChanges { target: incompleteBody; text: "Downloading message..." } |
489 | }, | 487 | }, |
490 | State { | 488 | State { |
491 | name: "error"; when: model.status == KubeFramework.MailListModel.ErrorStatus | 489 | name: "error"; when: model.status == Kube.MailListModel.ErrorStatus |
492 | PropertyChanges { target: incompleteBody; text: "Failed to download message..." } | 490 | PropertyChanges { target: incompleteBody; text: "Failed to download message..." } |
493 | } | 491 | } |
494 | ] | 492 | ] |
@@ -498,23 +496,23 @@ Rectangle { | |||
498 | 496 | ||
499 | anchors.bottom: parent.bottom | 497 | anchors.bottom: parent.bottom |
500 | 498 | ||
501 | height: KubeTheme.Units.gridUnit * 2 | 499 | height: Kube.Units.gridUnit * 2 |
502 | width: parent.width | 500 | width: parent.width |
503 | 501 | ||
504 | Text { | 502 | Text { |
505 | anchors{ | 503 | anchors{ |
506 | verticalCenter: parent.verticalCenter | 504 | verticalCenter: parent.verticalCenter |
507 | left: parent.left | 505 | left: parent.left |
508 | leftMargin: KubeTheme.Units.largeSpacing | 506 | leftMargin: Kube.Units.largeSpacing |
509 | } | 507 | } |
510 | 508 | ||
511 | KubeFramework.MailController { | 509 | Kube.MailController { |
512 | id: mailController | 510 | id: mailController |
513 | mail: model.mail | 511 | mail: model.mail |
514 | } | 512 | } |
515 | 513 | ||
516 | text: model.trash ? qsTr("Delete Mail") : qsTr("Move to trash") | 514 | text: model.trash ? qsTr("Delete Mail") : qsTr("Move to trash") |
517 | color: KubeTheme.Colors.textColor | 515 | color: Kube.Colors.textColor |
518 | opacity: 0.5 | 516 | opacity: 0.5 |
519 | enabled: model.trash ? mailController.removeAction.enabled : mailController.moveToTrashAction.enabled | 517 | enabled: model.trash ? mailController.removeAction.enabled : mailController.moveToTrashAction.enabled |
520 | MouseArea { | 518 | MouseArea { |
@@ -535,10 +533,10 @@ Rectangle { | |||
535 | anchors{ | 533 | anchors{ |
536 | verticalCenter: parent.verticalCenter | 534 | verticalCenter: parent.verticalCenter |
537 | right: parent.right | 535 | right: parent.right |
538 | rightMargin: KubeTheme.Units.largeSpacing | 536 | rightMargin: Kube.Units.largeSpacing |
539 | } | 537 | } |
540 | 538 | ||
541 | KubeAction.Context { | 539 | Kube.Context { |
542 | id: mailcontext | 540 | id: mailcontext |
543 | property variant mail | 541 | property variant mail |
544 | property bool isDraft | 542 | property bool isDraft |
@@ -546,19 +544,19 @@ Rectangle { | |||
546 | isDraft: model.draft | 544 | isDraft: model.draft |
547 | } | 545 | } |
548 | 546 | ||
549 | KubeAction.Action { | 547 | Kube.Action { |
550 | id: replyAction | 548 | id: replyAction |
551 | actionId: "org.kde.kube.actions.reply" | 549 | actionId: "org.kde.kube.actions.reply" |
552 | context: maillistcontext | 550 | context: maillistcontext |
553 | } | 551 | } |
554 | 552 | ||
555 | KubeAction.Action { | 553 | Kube.Action { |
556 | id: editAction | 554 | id: editAction |
557 | actionId: "org.kde.kube.actions.edit" | 555 | actionId: "org.kde.kube.actions.edit" |
558 | context: maillistcontext | 556 | context: maillistcontext |
559 | } | 557 | } |
560 | 558 | ||
561 | iconName: model.draft ? KubeTheme.Icons.edit : KubeTheme.Icons.replyToSender | 559 | iconName: model.draft ? Kube.Icons.edit : Kube.Icons.replyToSender |
562 | onClicked: { | 560 | onClicked: { |
563 | if (model.draft) { | 561 | if (model.draft) { |
564 | editAction.execute() | 562 | editAction.execute() |