summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--components/package/contents/ui/SingleMailView.qml213
1 files changed, 73 insertions, 140 deletions
diff --git a/components/package/contents/ui/SingleMailView.qml b/components/package/contents/ui/SingleMailView.qml
index 41c75224..632c8271 100644
--- a/components/package/contents/ui/SingleMailView.qml
+++ b/components/package/contents/ui/SingleMailView.qml
@@ -32,76 +32,10 @@ Item {
32 32
33 property variant mail; 33 property variant mail;
34 34
35 Rectangle {
36 id: subjectBar
37
38 anchors {
39 top: parent.top
40 left: parent.left
41 right: parent.right
42 }
43
44 height: Kirigami.Units.gridUnit * 2
45
46 color: Kirigami.Theme.backgroundColor
47
48 Kirigami.Heading {
49
50 anchors {
51 left: parent.left
52 leftMargin: Kirigami.Units.largeSpacing
53 verticalCenter: parent.verticalCenter
54 }
55
56 width: parent.width - Kirigami.Units.gridUnit * 5
57
58 text: "Some subject"
59 color: Kirigami.Theme.textColor
60 level: 4
61 font.italic: true
62
63 }
64
65 //TODO Make it clickable
66 Text {
67
68 anchors {
69 right: parent.right
70 rightMargin: Kirigami.Units.gridUnit * 0.2
71 bottom: parent.bottom
72 bottomMargin: Kirigami.Units.gridUnit * 0.2 + 1
73 }
74
75 //make it blue and lightgrey
76 text: "<b>Plaintext</b> / <i>HTML</i>"
77 color: Kirigami.Theme.textColor
78 font.pointSize: Kirigami.Theme.defaultFont.pointSize * 0.7
79
80 MouseArea {
81 anchors.fill: parent
82
83 onClicked: {
84 parent.text == "<b>Plaintext</b> / <i>HTML</i>" ? parent.text = "<i>Plaintext</i> / <b>HTML</b>" : parent.text = "<b>Plaintext</b> / <i>HTML</i>"
85 }
86 }
87 }
88
89 Rectangle {
90
91 anchors.bottom: parent.bottom
92
93 height: 1
94 width: parent.width
95
96 color: Kirigami.Theme.highlightColor
97 }
98 }
99
100
101 ListView { 35 ListView {
102 id: listView 36 id: listView
103 anchors { 37 anchors {
104 top: subjectBar.bottom 38 top: parent.top
105 left: parent.left 39 left: parent.left
106 right: parent.right 40 right: parent.right
107 bottom: parent.bottom 41 bottom: parent.bottom
@@ -161,110 +95,107 @@ Item {
161 margins: Kirigami.Units.largeSpacing 95 margins: Kirigami.Units.largeSpacing
162 } 96 }
163 97
164 height: from.height + to.height + Kirigami.Units.gridUnit + Kirigami.Units.smallSpacing 98 height: headerContent.height + Kirigami.Units.smallSpacing
165 99
166 Avatar { 100 Text {
167 id: avatar 101 id: date_label
168 102
169 anchors { 103 anchors {
104 right: seperator.right
170 top: parent.top 105 top: parent.top
171 topMargin: Kirigami.Units.smallSpacing
172 } 106 }
173 107
174 height: Kirigami.Units.gridUnit * 2.5 108 text: Qt.formatDateTime(model.date, "dd MMM yyyy hh:mm")
175 width: height
176 109
177 name: model.senderName 110 font.pointSize: Kirigami.Theme.defaultFont.pointSize * 0.7
111 color: Kirigami.Theme.textColor
112 opacity: 0.75
178 } 113 }
179 114
180 Row{ 115 Column {
181 id: from 116 id: headerContent
182 117
183 anchors { 118 anchors {
184 top: avatar.top 119 //left: to_l.right
185 left: avatar.right 120 horizontalCenter: parent.horizontalCenter
186 leftMargin: Kirigami.Units.smallSpacing * 2
187 topMargin: Kirigami.Units.smallSpacing
188 } 121 }
189 122
190 width: parent.width - avatar.width - Kirigami.Units.largeSpacing * 2 123 //spacing: Kirigami.Units.smallSpacing
191 124
192 spacing: Kirigami.Units.smallSpacing 125 width: parent.width
193 clip: true
194 126
195 Text { 127 Row{
196 id: senderName 128 id: from
197 129
198 text: model.senderName 130 width: parent.width
199 131
200 font.weight: Font.DemiBold 132 spacing: Kirigami.Units.smallSpacing
201 color: Kirigami.Theme.textColor 133 clip: true
202 opacity: 0.75
203 }
204 134
205 Text { 135 Text {
136 id: senderName
206 137
207 width: parent.width - senderName.width - Kirigami.Units.smallSpacing 138 text: model.senderName
208 139
209 text: model.sender 140 font.weight: Font.DemiBold
141 color: Kirigami.Theme.textColor
142 opacity: 0.75
143 }
210 144
211 color: Kirigami.Theme.textColor 145 Text {
212 opacity: 0.75
213 146
214 elide: Text.ElideRight 147 text: model.sender
215 }
216 }
217 148
218 Text { 149 width: parent.width - senderName.width - date_label.width - Kirigami.Units.largeSpacing
219 id: to_label
220 150
221 anchors { 151 color: Kirigami.Theme.textColor
222 top: from.bottom 152 opacity: 0.75
223 left: avatar.right
224 leftMargin: Kirigami.Units.smallSpacing * 2
225 topMargin: Kirigami.Units.smallSpacing * 0.5
226 }
227 153
228 text: "to:" 154 clip: true
155 }
156 }
229 157
230 color: Kirigami.Theme.textColor 158 Text {
231 opacity: 0.75 159 text: model.subject
232 }
233 160
234 Text { 161 color: Kirigami.Theme.textColor
235 id: to 162 opacity: 0.75
236 163
237 anchors { 164 font.italic: true
238 top: to_label.top
239 left: to_label.right
240 leftMargin: Kirigami.Units.smallSpacing
241 } 165 }
242 166
243 width: parent.width - avatar.width - to_label.width - Kirigami.Units.largeSpacing * 2 167 Text {
244 168 id: to
245 text: model.to + " " + model.cc + " " + model.bcc
246 169
247 maximumLineCount: 3 170 anchors {
248 wrapMode: Text.WrapAnywhere 171 top: to_label.top
249 elide: Text.ElideRight 172 left: to_label.right
173 leftMargin: Kirigami.Units.smallSpacing
174 }
250 175
251 color: Kirigami.Theme.textColor 176 text:"to: "+ model.to + " " + model.cc + " " + model.bcc
252 opacity: 0.75
253 clip: true
254 }
255 177
256 Text { 178 color: Kirigami.Theme.textColor
179 opacity: 0.75
180 }
257 181
182 }
183 Rectangle {
258 anchors { 184 anchors {
185 bottom: seperator.top
259 right: seperator.right 186 right: seperator.right
260 top: parent.top
261 } 187 }
262 188
263 text: Qt.formatDateTime(model.date, "dd MMM yyyy hh:mm") 189 height: Kirigami.Units.gridUnit
190 width: height
264 191
265 font.pointSize: Kirigami.Theme.defaultFont.pointSize * 0.7 192 color: Kirigami.Theme.backgroundColor
266 color: Kirigami.Theme.textColor 193
267 opacity: 0.75 194 Controls1.ToolButton {
195 anchors.fill: parent
196
197 iconName: "go-down"
198 }
268 } 199 }
269 200
270 Rectangle { 201 Rectangle {
@@ -308,14 +239,14 @@ Item {
308 anchors { 239 anchors {
309 top: header.bottom 240 top: header.bottom
310 topMargin: Kirigami.Units.smallSpacing 241 topMargin: Kirigami.Units.smallSpacing
311 horizontalCenter: parent.horizontalCenter 242 right: header.right
312 } 243 }
313 244
314 width: parent.width - Kirigami.Units.gridUnit * 2 245 width: header.width - Kirigami.Units.largeSpacing
315 height: Kirigami.Units.gridUnit * 2
316 246
317 layoutDirection: Qt.RightToLeft 247 layoutDirection: Qt.RightToLeft
318 spacing: Kirigami.Units.smallSpacing 248 spacing: Kirigami.Units.smallSpacing
249 clip: true
319 250
320 Repeater { 251 Repeater {
321 model: body.attachments 252 model: body.attachments
@@ -324,6 +255,8 @@ Item {
324 name: model.name 255 name: model.name
325 icon: "mail-attachment" 256 icon: "mail-attachment"
326 257
258 clip: true
259
327 //TODO size encrypted signed type 260 //TODO size encrypted signed type
328 } 261 }
329 } 262 }
@@ -334,11 +267,11 @@ Item {
334 267
335 anchors { 268 anchors {
336 top: header.bottom 269 top: header.bottom
337 left: parent.left 270 left: header.left
338 right: parent.right 271 right: header.right
339 leftMargin: avatar.height + Kirigami.Units.gridUnit 272 leftMargin: Kirigami.Units.largeSpacing
340 rightMargin: avatar.height + Kirigami.Units.gridUnit 273 rightMargin: Kirigami.Units.largeSpacing
341 topMargin: avatar.height 274 topMargin: Math.max(attachments.height, Kirigami.Units.largeSpacing)
342 } 275 }
343 276
344 width: header.width - Kirigami.Units.largeSpacing * 2 277 width: header.width - Kirigami.Units.largeSpacing * 2