summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--components/package/contents/ui/AttachmentDelegate.qml5
-rw-r--r--components/package/contents/ui/MailViewer.qml47
-rw-r--r--components/package/contents/ui/SingleMailView.qml30
3 files changed, 35 insertions, 47 deletions
diff --git a/components/package/contents/ui/AttachmentDelegate.qml b/components/package/contents/ui/AttachmentDelegate.qml
index 91e07d49..ffacb46c 100644
--- a/components/package/contents/ui/AttachmentDelegate.qml
+++ b/components/package/contents/ui/AttachmentDelegate.qml
@@ -21,6 +21,7 @@ import QtQuick.Layouts 1.1
21import org.kde.kirigami 1.0 as Kirigami 21import org.kde.kirigami 1.0 as Kirigami
22 22
23Item { 23Item {
24 id: root
24 25
25 property string name 26 property string name
26 property string icon 27 property string icon
@@ -54,12 +55,12 @@ Item {
54 height: parent.height 55 height: parent.height
55 width: height 56 width: height
56 57
57 source: "text-csv" 58 source: root.icon
58 } 59 }
59 } 60 }
60 61
61 Text { 62 Text {
62 text: "some attachment.csv" 63 text: root.name
63 color: Kirigami.Theme.textColor 64 color: Kirigami.Theme.textColor
64 } 65 }
65 } 66 }
diff --git a/components/package/contents/ui/MailViewer.qml b/components/package/contents/ui/MailViewer.qml
index 28414cac..f5e10c84 100644
--- a/components/package/contents/ui/MailViewer.qml
+++ b/components/package/contents/ui/MailViewer.qml
@@ -27,7 +27,8 @@ Item {
27 id: root 27 id: root
28 property variant message; 28 property variant message;
29 property string html; 29 property string html;
30 property int desiredHeight: topPartLoader.height + newMailViewer.height + attachments.height + 20 30 property int desiredHeight: topPartLoader.height + newMailViewer.height + 20
31 property variant attachments
31 32
32 clip: true 33 clip: true
33 34
@@ -57,48 +58,6 @@ Item {
57 //END old mail viewer 58 //END old mail viewer
58 59
59 Controls1.TreeView { 60 Controls1.TreeView {
60 id: attachments
61 anchors {
62 top: newMailViewer.bottom
63 topMargin: 20
64 }
65 //visible: messageParser.attachments.rowCount() > 0
66 width: parent.width
67 height: 200
68 Controls1.TableViewColumn {
69 role: "name"
70 title: "Filename"
71 width: 300
72 }
73 Controls1.TableViewColumn {
74 role: "type"
75 title: "Type"
76 width: 60
77 }
78 Controls1.TableViewColumn {
79 role: "icon"
80 title: "Icon"
81 width: 60
82 }
83 Controls1.TableViewColumn {
84 role: "size"
85 title: "Size"
86 width: 60
87 }
88 Controls1.TableViewColumn {
89 role: "encrypted"
90 title: "Encrypted"
91 width: 60
92 }
93 Controls1.TableViewColumn {
94 role: "signed"
95 title: "Signed"
96 width: 60
97 }
98 model: messageParser.attachments
99 }
100
101 Controls1.TreeView {
102 id: mailStructure 61 id: mailStructure
103 anchors.top: messageParser.attachments.rowCount() > 0 ? attachments.bottom : newMailViewer.bottom 62 anchors.top: messageParser.attachments.rowCount() > 0 ? attachments.bottom : newMailViewer.bottom
104 visible: newMailViewer.debug 63 visible: newMailViewer.debug
@@ -131,6 +90,6 @@ Item {
131 id: messageParser 90 id: messageParser
132 message: root.message 91 message: root.message
133 } 92 }
93 attachments: messageParser.attachments
134 html: messageParser.html 94 html: messageParser.html
135
136} 95}
diff --git a/components/package/contents/ui/SingleMailView.qml b/components/package/contents/ui/SingleMailView.qml
index 76f0ef2e..732bec3b 100644
--- a/components/package/contents/ui/SingleMailView.qml
+++ b/components/package/contents/ui/SingleMailView.qml
@@ -72,7 +72,6 @@ Rectangle {
72 } 72 }
73 73
74 Rectangle { 74 Rectangle {
75
76 anchors.bottom: parent.bottom 75 anchors.bottom: parent.bottom
77 76
78 height: 1 77 height: 1
@@ -124,6 +123,8 @@ Rectangle {
124 implicitHeight: header.height + body.height + (Kirigami.Units.gridUnit * 2.5) * 2 + footer.height 123 implicitHeight: header.height + body.height + (Kirigami.Units.gridUnit * 2.5) * 2 + footer.height
125 width: parent.width - Kirigami.Units.gridUnit * 4 124 width: parent.width - Kirigami.Units.gridUnit * 4
126 125
126 color: Kirigami.Theme.viewBackgroundColor
127
127 //TODO bookmark 128 //TODO bookmark
128 /* 129 /*
129 ToolButton { 130 ToolButton {
@@ -255,6 +256,33 @@ Rectangle {
255 } 256 }
256 //END header 257 //END header
257 258
259 Flow {
260 id: attachments
261
262 anchors {
263 top: header.bottom
264 topMargin: Kirigami.Units.smallSpacing
265 horizontalCenter: parent.horizontalCenter
266 }
267
268 width: parent.width - Kirigami.Units.gridUnit * 2
269 height: Kirigami.Units.gridUnit * 2
270
271 layoutDirection: Qt.RightToLeft
272 spacing: Kirigami.Units.smallSpacing
273
274 Repeater {
275 model: body.attachments
276
277 delegate: AttachmentDelegate {
278 name: model.name
279 icon: "mail-attachment"
280
281 //TODO size encrypted signed type
282 }
283 }
284 }
285
258 MailViewer { 286 MailViewer {
259 id: body 287 id: body
260 288