diff options
Diffstat (limited to 'components/mailviewer')
-rw-r--r-- | components/mailviewer/contents/ui/MailDataModel.qml | 19 | ||||
-rw-r--r-- | components/mailviewer/contents/ui/MailPart.qml | 41 | ||||
-rw-r--r-- | components/mailviewer/contents/ui/MailViewer.qml | 1 | ||||
-rw-r--r-- | components/mailviewer/contents/ui/TextContent.qml | 9 |
4 files changed, 43 insertions, 27 deletions
diff --git a/components/mailviewer/contents/ui/MailDataModel.qml b/components/mailviewer/contents/ui/MailDataModel.qml index 46427194..0f64972c 100644 --- a/components/mailviewer/contents/ui/MailDataModel.qml +++ b/components/mailviewer/contents/ui/MailDataModel.qml | |||
@@ -21,8 +21,7 @@ import QtQml.Models 2.2 | |||
21 | import org.kube.framework 1.0 as Kube | 21 | import org.kube.framework 1.0 as Kube |
22 | 22 | ||
23 | DelegateModel { | 23 | DelegateModel { |
24 | id: mailDataModel | 24 | id: root |
25 | property bool debug: true | ||
26 | 25 | ||
27 | delegate: Item { | 26 | delegate: Item { |
28 | id: partColumn | 27 | id: partColumn |
@@ -65,13 +64,13 @@ DelegateModel { | |||
65 | partLoader.setSource("TextContent.qml", | 64 | partLoader.setSource("TextContent.qml", |
66 | {"content": model.content, | 65 | {"content": model.content, |
67 | "embedded": model.embeded, | 66 | "embedded": model.embeded, |
68 | "type": model.type, | 67 | "type": model.type |
69 | "debug": debug}) | 68 | }) |
70 | break | 69 | break |
71 | case "html": | 70 | case "html": |
72 | partLoader.setSource("HtmlContent.qml", | 71 | partLoader.setSource("HtmlContent.qml", |
73 | {"content": model.content, | 72 | {"content": model.content, |
74 | "debug": debug}) | 73 | }) |
75 | break; | 74 | break; |
76 | case "error": | 75 | case "error": |
77 | partLoader.setSource("ErrorPart.qml", | 76 | partLoader.setSource("ErrorPart.qml", |
@@ -80,11 +79,13 @@ DelegateModel { | |||
80 | "errorString": model.errorString, | 79 | "errorString": model.errorString, |
81 | }) | 80 | }) |
82 | break; | 81 | break; |
83 | case "envelope": | 82 | case "encapsulated": |
84 | partLoader.setSource("MailPart.qml", | 83 | partLoader.setSource("MailPart.qml", |
85 | {"rootIndex": mailDataModel.modelIndex(index), | 84 | {"rootIndex": root.modelIndex(index), |
86 | "model": mailDataModel.model, | 85 | "model": root.model, |
87 | "debug": debug}) | 86 | "sender": model.sender, |
87 | "date": model.date | ||
88 | }) | ||
88 | break; | 89 | break; |
89 | } | 90 | } |
90 | } | 91 | } |
diff --git a/components/mailviewer/contents/ui/MailPart.qml b/components/mailviewer/contents/ui/MailPart.qml index bf534e85..7ff426e9 100644 --- a/components/mailviewer/contents/ui/MailPart.qml +++ b/components/mailviewer/contents/ui/MailPart.qml | |||
@@ -18,29 +18,54 @@ | |||
18 | 18 | ||
19 | import QtQuick 2.4 | 19 | import QtQuick 2.4 |
20 | 20 | ||
21 | import org.kube.framework 1.0 as Kube | ||
22 | |||
21 | Item { | 23 | Item { |
22 | id: root | 24 | id: root |
23 | property alias rootIndex: visualModel.rootIndex | 25 | property alias rootIndex: visualModel.rootIndex |
24 | property alias model: visualModel.model | 26 | property alias model: visualModel.model |
25 | property alias debug: visualModel.debug | 27 | property variant sender |
26 | height: partListView.height + 10 | 28 | property variant date |
27 | width: parent.width | 29 | height: childrenRect.height |
28 | 30 | ||
29 | MailDataModel { | 31 | MailDataModel { |
30 | id: visualModel | 32 | id: visualModel |
31 | } | 33 | } |
32 | 34 | ||
35 | Rectangle { | ||
36 | id: border | ||
37 | anchors { | ||
38 | top: parent.top | ||
39 | left: parent.left | ||
40 | leftMargin: Kube.Units.smallSpacing | ||
41 | } | ||
42 | color: "lightgrey" | ||
43 | height: partListView.height | ||
44 | width: Kube.Units.smallSpacing | ||
45 | } | ||
46 | |||
47 | Text { | ||
48 | id: sender | ||
49 | anchors { | ||
50 | left: border.right | ||
51 | leftMargin: Kube.Units.smallSpacing | ||
52 | } | ||
53 | |||
54 | text: "sent by " + root.sender + " on " + root.date | ||
55 | color: "grey" | ||
56 | } | ||
33 | ListView { | 57 | ListView { |
34 | id: partListView | 58 | id: partListView |
35 | model: visualModel | 59 | model: visualModel |
36 | anchors { | 60 | anchors { |
37 | top: parent.top | 61 | top: sender.bottom |
38 | left: parent.left | 62 | left: border.right |
39 | margins: 5 | 63 | margins: Kube.Units.smallSpacing |
64 | leftMargin: Kube.Units.smallSpacing | ||
40 | } | 65 | } |
41 | spacing: 5 | 66 | spacing: 7 |
42 | height: contentHeight | 67 | height: contentHeight |
43 | width: parent.width - 10 | 68 | width: parent.width - Kube.Units.smallSpacing * 3 |
44 | interactive: false | 69 | interactive: false |
45 | } | 70 | } |
46 | } | 71 | } |
diff --git a/components/mailviewer/contents/ui/MailViewer.qml b/components/mailviewer/contents/ui/MailViewer.qml index 23307009..9031ec17 100644 --- a/components/mailviewer/contents/ui/MailViewer.qml +++ b/components/mailviewer/contents/ui/MailViewer.qml | |||
@@ -22,7 +22,6 @@ Item { | |||
22 | id: root | 22 | id: root |
23 | property alias rootIndex: visualModel.rootIndex | 23 | property alias rootIndex: visualModel.rootIndex |
24 | property alias model: visualModel.model | 24 | property alias model: visualModel.model |
25 | property alias debug: visualModel.debug | ||
26 | height: partListView.height | 25 | height: partListView.height |
27 | 26 | ||
28 | MailDataModel { | 27 | MailDataModel { |
diff --git a/components/mailviewer/contents/ui/TextContent.qml b/components/mailviewer/contents/ui/TextContent.qml index f8ef7f9a..a0094a3e 100644 --- a/components/mailviewer/contents/ui/TextContent.qml +++ b/components/mailviewer/contents/ui/TextContent.qml | |||
@@ -24,7 +24,6 @@ Item { | |||
24 | id: root | 24 | id: root |
25 | 25 | ||
26 | property string content | 26 | property string content |
27 | property bool debug: true | ||
28 | property bool embedded: true | 27 | property bool embedded: true |
29 | property string type | 28 | property string type |
30 | 29 | ||
@@ -54,13 +53,5 @@ Item { | |||
54 | color: embedded ? Kube.Colors.disabledTextColor : Kube.Colors.textColor | 53 | color: embedded ? Kube.Colors.disabledTextColor : Kube.Colors.textColor |
55 | onLinkActivated: Qt.openUrlExternally(link) | 54 | onLinkActivated: Qt.openUrlExternally(link) |
56 | } | 55 | } |
57 | |||
58 | //BEGIN debug | ||
59 | Text { | ||
60 | width: parent.width | ||
61 | visible: root.debug | ||
62 | text: type | ||
63 | } | ||
64 | //END debug | ||
65 | } | 56 | } |
66 | } | 57 | } |