diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-05-23 14:47:49 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-05-23 14:47:49 +0200 |
commit | c1ca732bafc60f5c140ef5516e32bd46503bf68c (patch) | |
tree | 2239c5c134b7a9c6133e3429d9ff6e0d57b195bf /framework/qml/MailViewer.qml | |
parent | ac5b95cb2b9d307d7e7207e947fd7dc3f53503cf (diff) | |
download | kube-c1ca732bafc60f5c140ef5516e32bd46503bf68c.tar.gz kube-c1ca732bafc60f5c140ef5516e32bd46503bf68c.zip |
A simple debug view
Diffstat (limited to 'framework/qml/MailViewer.qml')
-rw-r--r-- | framework/qml/MailViewer.qml | 77 |
1 files changed, 76 insertions, 1 deletions
diff --git a/framework/qml/MailViewer.qml b/framework/qml/MailViewer.qml index b9a48d51..aae43994 100644 --- a/framework/qml/MailViewer.qml +++ b/framework/qml/MailViewer.qml | |||
@@ -25,7 +25,6 @@ import QtQuick.Layouts 1.1 | |||
25 | import org.kube.components.mailviewer 1.0 as MV | 25 | import org.kube.components.mailviewer 1.0 as MV |
26 | import org.kube.framework 1.0 as Kube | 26 | import org.kube.framework 1.0 as Kube |
27 | 27 | ||
28 | import QtQuick.Layouts 1.1 | ||
29 | import org.kde.kirigami 1.0 as Kirigami | 28 | import org.kde.kirigami 1.0 as Kirigami |
30 | 29 | ||
31 | Rectangle { | 30 | Rectangle { |
@@ -43,9 +42,16 @@ Rectangle { | |||
43 | property variant draft; | 42 | property variant draft; |
44 | property variant sent; | 43 | property variant sent; |
45 | property bool incomplete: false; | 44 | property bool incomplete: false; |
45 | property bool current: false; | ||
46 | 46 | ||
47 | implicitHeight: header.height + attachments.height + body.height + incompleteBody.height + footer.height + Kube.Units.largeSpacing | 47 | implicitHeight: header.height + attachments.height + body.height + incompleteBody.height + footer.height + Kube.Units.largeSpacing |
48 | 48 | ||
49 | Shortcut { | ||
50 | sequence: "V" | ||
51 | onActivated: debugPopup.open() | ||
52 | enabled: root.current | ||
53 | } | ||
54 | |||
49 | //Overlay for non-active mails | 55 | //Overlay for non-active mails |
50 | Rectangle { | 56 | Rectangle { |
51 | anchors.fill: parent | 57 | anchors.fill: parent |
@@ -386,4 +392,73 @@ Rectangle { | |||
386 | } | 392 | } |
387 | } | 393 | } |
388 | } | 394 | } |
395 | |||
396 | Kube.Popup { | ||
397 | id: debugPopup | ||
398 | modal: true | ||
399 | closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutsideParent | ||
400 | x: 0 | ||
401 | y: 0 | ||
402 | width: root.width | ||
403 | height: root.height | ||
404 | |||
405 | Flickable { | ||
406 | id: flickable | ||
407 | anchors.fill: parent | ||
408 | contentHeight: content.height | ||
409 | contentWidth: parent.width | ||
410 | Column { | ||
411 | id: content | ||
412 | width: flickable.width | ||
413 | height: childrenRect.height | ||
414 | |||
415 | Controls1.TreeView { | ||
416 | id: mailStructure | ||
417 | width: parent.width | ||
418 | height: implicitHeight | ||
419 | Controls1.TableViewColumn { | ||
420 | role: "type" | ||
421 | title: "Type" | ||
422 | } | ||
423 | Controls1.TableViewColumn { | ||
424 | role: "embeded" | ||
425 | title: "Embeded" | ||
426 | } | ||
427 | Controls1.TableViewColumn { | ||
428 | role: "securityLevel" | ||
429 | title: "SecurityLevel" | ||
430 | } | ||
431 | Controls1.TableViewColumn { | ||
432 | role: "content" | ||
433 | title: "Content" | ||
434 | } | ||
435 | model: messageParser.newTree | ||
436 | itemDelegate: Item { | ||
437 | property variant currentData: styleData.value | ||
438 | Text { | ||
439 | anchors.verticalCenter: parent.verticalCenter | ||
440 | color: styleData.textColor | ||
441 | elide: styleData.elideMode | ||
442 | text: styleData.value | ||
443 | } | ||
444 | MouseArea { | ||
445 | anchors.fill: parent | ||
446 | onClicked: { | ||
447 | textEdit.text = styleData.value | ||
448 | } | ||
449 | } | ||
450 | } | ||
451 | } | ||
452 | TextEdit { | ||
453 | id: textEdit | ||
454 | width: parent.width | ||
455 | readOnly: true | ||
456 | selectByMouse: true | ||
457 | textFormat: TextEdit.PlainText | ||
458 | wrapMode: TextEdit.Wrap | ||
459 | height: implicitHeight | ||
460 | } | ||
461 | } | ||
462 | } | ||
463 | } | ||
389 | } | 464 | } |