diff options
author | Michael Bohlender <michael.bohlender@kdemail.net> | 2016-12-08 13:02:12 +0100 |
---|---|---|
committer | Michael Bohlender <michael.bohlender@kdemail.net> | 2016-12-08 13:02:12 +0100 |
commit | 13fe0524034d7fe3b7fa3a39f8df5ebeade9140e (patch) | |
tree | b074e976b6f6cf97fa44de9f7f496e8ed26f729b /components/package/contents/ui | |
parent | f66b8d7c91056cd457fe86f8a816021d9802d0a6 (diff) | |
download | kube-13fe0524034d7fe3b7fa3a39f8df5ebeade9140e.tar.gz kube-13fe0524034d7fe3b7fa3a39f8df5ebeade9140e.zip |
remove unnessesary flickable in conversation view
Diffstat (limited to 'components/package/contents/ui')
-rw-r--r-- | components/package/contents/ui/SingleMailView.qml | 379 |
1 files changed, 186 insertions, 193 deletions
diff --git a/components/package/contents/ui/SingleMailView.qml b/components/package/contents/ui/SingleMailView.qml index 49585b03..02ec504d 100644 --- a/components/package/contents/ui/SingleMailView.qml +++ b/components/package/contents/ui/SingleMailView.qml | |||
@@ -1,20 +1,20 @@ | |||
1 | /* | 1 | /* |
2 | Copyright (C) 2016 Michael Bohlender, <michael.bohlender@kdemail.net> | 2 | * Copyright (C) 2016 Michael Bohlender, <michael.bohlender@kdemail.net> |
3 | 3 | * | |
4 | This program is free software; you can redistribute it and/or modify | 4 | * This program is free software; you can redistribute it and/or modify |
5 | it under the terms of the GNU General Public License as published by | 5 | * it under the terms of the GNU General Public License as published by |
6 | the Free Software Foundation; either version 2 of the License, or | 6 | * the Free Software Foundation; either version 2 of the License, or |
7 | (at your option) any later version. | 7 | * (at your option) any later version. |
8 | 8 | * | |
9 | This program is distributed in the hope that it will be useful, | 9 | * This program is distributed in the hope that it will be useful, |
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | GNU General Public License for more details. | 12 | * GNU General Public License for more details. |
13 | 13 | * | |
14 | You should have received a copy of the GNU General Public License along | 14 | * You should have received a copy of the GNU General Public License along |
15 | with this program; if not, write to the Free Software Foundation, Inc., | 15 | * with this program; if not, write to the Free Software Foundation, Inc., |
16 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
17 | */ | 17 | */ |
18 | 18 | ||
19 | import QtQuick 2.4 | 19 | import QtQuick 2.4 |
20 | import QtQuick.Controls 1.3 | 20 | import QtQuick.Controls 1.3 |
@@ -82,9 +82,7 @@ Rectangle { | |||
82 | } | 82 | } |
83 | 83 | ||
84 | 84 | ||
85 | Flickable { | 85 | ListView { |
86 | id: flickable | ||
87 | |||
88 | anchors { | 86 | anchors { |
89 | top: subjectBar.bottom | 87 | top: subjectBar.bottom |
90 | left: parent.left | 88 | left: parent.left |
@@ -94,245 +92,240 @@ Rectangle { | |||
94 | 92 | ||
95 | clip: true | 93 | clip: true |
96 | 94 | ||
97 | ListView { | 95 | model: KubeFramework.MailListModel { |
98 | anchors.fill: parent | 96 | mail: root.mail |
97 | } | ||
99 | 98 | ||
100 | model: KubeFramework.MailListModel { | 99 | header: Item { |
101 | mail: root.mail | 100 | height: Kirigami.Units.gridUnit |
102 | } | 101 | width: parent.width |
103 | 102 | ||
104 | header: Item { | 103 | } |
105 | height: Kirigami.Units.gridUnit | ||
106 | width: parent.width | ||
107 | 104 | ||
108 | } | 105 | footer: Item { |
106 | height: Kirigami.Units.gridUnit * 2 | ||
107 | width: parent.width | ||
108 | } | ||
109 | 109 | ||
110 | footer: Item { | 110 | delegate: Item { |
111 | height: Kirigami.Units.gridUnit * 2 | ||
112 | width: parent.width | ||
113 | } | ||
114 | 111 | ||
115 | delegate: Item { | 112 | height: sheet.height + Kirigami.Units.gridUnit * 2 |
113 | width: parent.width | ||
116 | 114 | ||
117 | height: sheet.height + Kirigami.Units.gridUnit * 2 | 115 | Rectangle { |
118 | width: parent.width | 116 | id: sheet |
117 | anchors.centerIn: parent | ||
118 | implicitHeight: header.height + body.height + (Kirigami.Units.gridUnit * 2.5) * 2 + footer.height | ||
119 | width: parent.width - Kirigami.Units.gridUnit * 4 | ||
119 | 120 | ||
120 | Rectangle { | 121 | color: Kirigami.Theme.viewBackgroundColor |
121 | id: sheet | ||
122 | anchors.centerIn: parent | ||
123 | implicitHeight: header.height + body.height + (Kirigami.Units.gridUnit * 2.5) * 2 + footer.height | ||
124 | width: parent.width - Kirigami.Units.gridUnit * 4 | ||
125 | 122 | ||
126 | color: Kirigami.Theme.viewBackgroundColor | 123 | //TODO bookmark |
124 | /* | ||
125 | * ToolButton { | ||
126 | * iconName: "bookmark-new" | ||
127 | * | ||
128 | } | ||
129 | */ | ||
130 | //BEGIN header | ||
131 | Item { | ||
132 | id: header | ||
127 | 133 | ||
128 | //TODO bookmark | 134 | height: Kirigami.Units.gridUnit * 5 |
129 | /* | 135 | width: parent.width |
130 | ToolButton { | ||
131 | iconName: "bookmark-new" | ||
132 | 136 | ||
133 | } | 137 | Row { |
134 | */ | 138 | id: headerContent |
135 | //BEGIN header | 139 | anchors { |
136 | Item { | 140 | left: seperator.left |
137 | id: header | 141 | bottom: seperator.top |
138 | 142 | bottomMargin: height * 0.25 | |
139 | height: Kirigami.Units.gridUnit * 5 | 143 | } |
140 | width: parent.width | ||
141 | |||
142 | Row { | ||
143 | id: headerContent | ||
144 | anchors { | ||
145 | left: seperator.left | ||
146 | bottom: seperator.top | ||
147 | bottomMargin: height * 0.25 | ||
148 | } | ||
149 | 144 | ||
150 | spacing: Kirigami.Units.largeSpacing / 2 | 145 | spacing: Kirigami.Units.largeSpacing / 2 |
151 | 146 | ||
152 | Avatar { | 147 | Avatar { |
153 | id: avatar | 148 | id: avatar |
154 | 149 | ||
155 | height: Kirigami.Units.gridUnit * 2.5 | 150 | height: Kirigami.Units.gridUnit * 2.5 |
156 | width: height | 151 | width: height |
157 | 152 | ||
158 | name: model.senderName | 153 | name: model.senderName |
159 | } | 154 | } |
160 | 155 | ||
161 | ColumnLayout { | 156 | ColumnLayout { |
162 | 157 | ||
163 | RowLayout { | 158 | RowLayout { |
164 | 159 | ||
165 | Text { | 160 | Text { |
166 | text: model.senderName | 161 | text: model.senderName |
167 | 162 | ||
168 | font.weight: Font.DemiBold | 163 | font.weight: Font.DemiBold |
169 | color: Kirigami.Theme.textColor | 164 | color: Kirigami.Theme.textColor |
170 | opacity: 0.75 | 165 | opacity: 0.75 |
171 | } | 166 | } |
172 | 167 | ||
173 | Text { | 168 | Text { |
174 | text: model.sender | 169 | text: model.sender |
175 | 170 | ||
176 | color: Kirigami.Theme.textColor | 171 | color: Kirigami.Theme.textColor |
177 | opacity: 0.75 | 172 | opacity: 0.75 |
178 | } | ||
179 | } | 173 | } |
174 | } | ||
180 | 175 | ||
181 | RowLayout { | 176 | RowLayout { |
182 | Kirigami.Label { | 177 | Kirigami.Label { |
183 | text: "To:" | 178 | text: "To:" |
184 | } | ||
185 | Text { | ||
186 | text: model.to | ||
187 | |||
188 | color: Kirigami.Theme.textColor | ||
189 | opacity: 0.75 | ||
190 | } | ||
191 | Text { | ||
192 | text: model.cc | ||
193 | |||
194 | color: Kirigami.Theme.textColor | ||
195 | opacity: 0.75 | ||
196 | } | ||
197 | Text { | ||
198 | text: model.bcc | ||
199 | |||
200 | color: Kirigami.Theme.textColor | ||
201 | opacity: 0.75 | ||
202 | } | ||
203 | } | 179 | } |
204 | } | 180 | Text { |
205 | } | 181 | text: model.to |
182 | |||
183 | color: Kirigami.Theme.textColor | ||
184 | opacity: 0.75 | ||
185 | } | ||
186 | Text { | ||
187 | text: model.cc | ||
206 | 188 | ||
207 | Text { | 189 | color: Kirigami.Theme.textColor |
190 | opacity: 0.75 | ||
191 | } | ||
192 | Text { | ||
193 | text: model.bcc | ||
208 | 194 | ||
209 | anchors { | 195 | color: Kirigami.Theme.textColor |
210 | right: seperator.right | 196 | opacity: 0.75 |
211 | bottom: headerContent.top | 197 | } |
212 | } | 198 | } |
199 | } | ||
200 | } | ||
213 | 201 | ||
214 | text: Qt.formatDateTime(model.date, "dd MMM yyyy hh:mm") | 202 | Text { |
215 | 203 | ||
216 | font.pointSize: Kirigami.Theme.defaultFont.pointSize * 0.7 | 204 | anchors { |
217 | color: Kirigami.Theme.textColor | 205 | right: seperator.right |
218 | opacity: 0.75 | 206 | bottom: headerContent.top |
219 | } | 207 | } |
220 | 208 | ||
221 | Rectangle { | 209 | text: Qt.formatDateTime(model.date, "dd MMM yyyy hh:mm") |
222 | id: seperator | ||
223 | 210 | ||
224 | anchors { | 211 | font.pointSize: Kirigami.Theme.defaultFont.pointSize * 0.7 |
225 | bottom: parent.bottom | 212 | color: Kirigami.Theme.textColor |
226 | horizontalCenter: parent.horizontalCenter | 213 | opacity: 0.75 |
227 | } | 214 | } |
228 | 215 | ||
229 | width: parent.width - Kirigami.Units.gridUnit * 2 | 216 | Rectangle { |
230 | height: 1 | 217 | id: seperator |
231 | 218 | ||
232 | color: Kirigami.Theme.textColor | 219 | anchors { |
233 | opacity: 0.5 | 220 | bottom: parent.bottom |
221 | horizontalCenter: parent.horizontalCenter | ||
234 | } | 222 | } |
235 | 223 | ||
236 | Rectangle { | 224 | width: parent.width - Kirigami.Units.gridUnit * 2 |
237 | anchors { | 225 | height: 1 |
238 | bottom: seperator.top | ||
239 | right: seperator.right | ||
240 | } | ||
241 | 226 | ||
242 | height: Kirigami.Units.gridUnit | 227 | color: Kirigami.Theme.textColor |
243 | width: height | 228 | opacity: 0.5 |
229 | } | ||
244 | 230 | ||
245 | color: Kirigami.Theme.textColor | 231 | Rectangle { |
246 | opacity: 0.5 | 232 | anchors { |
233 | bottom: seperator.top | ||
234 | right: seperator.right | ||
235 | } | ||
247 | 236 | ||
248 | ToolButton { | 237 | height: Kirigami.Units.gridUnit |
249 | anchors.fill: parent | 238 | width: height |
250 | 239 | ||
251 | onClicked: { | 240 | color: Kirigami.Theme.textColor |
252 | console.error(model.mimeMessage) | 241 | opacity: 0.5 |
253 | } | 242 | |
243 | ToolButton { | ||
244 | anchors.fill: parent | ||
245 | |||
246 | onClicked: { | ||
247 | console.error(model.mimeMessage) | ||
254 | } | 248 | } |
255 | } | 249 | } |
256 | } | 250 | } |
257 | //END header | 251 | } |
252 | //END header | ||
258 | 253 | ||
259 | Flow { | 254 | Flow { |
260 | id: attachments | 255 | id: attachments |
261 | 256 | ||
262 | anchors { | 257 | anchors { |
263 | top: header.bottom | 258 | top: header.bottom |
264 | topMargin: Kirigami.Units.smallSpacing | 259 | topMargin: Kirigami.Units.smallSpacing |
265 | horizontalCenter: parent.horizontalCenter | 260 | horizontalCenter: parent.horizontalCenter |
266 | } | 261 | } |
267 | 262 | ||
268 | width: parent.width - Kirigami.Units.gridUnit * 2 | 263 | width: parent.width - Kirigami.Units.gridUnit * 2 |
269 | height: Kirigami.Units.gridUnit * 2 | 264 | height: Kirigami.Units.gridUnit * 2 |
270 | 265 | ||
271 | layoutDirection: Qt.RightToLeft | 266 | layoutDirection: Qt.RightToLeft |
272 | spacing: Kirigami.Units.smallSpacing | 267 | spacing: Kirigami.Units.smallSpacing |
273 | 268 | ||
274 | Repeater { | 269 | Repeater { |
275 | model: body.attachments | 270 | model: body.attachments |
276 | 271 | ||
277 | delegate: AttachmentDelegate { | 272 | delegate: AttachmentDelegate { |
278 | name: model.name | 273 | name: model.name |
279 | icon: "mail-attachment" | 274 | icon: "mail-attachment" |
280 | 275 | ||
281 | //TODO size encrypted signed type | 276 | //TODO size encrypted signed type |
282 | } | ||
283 | } | 277 | } |
284 | } | 278 | } |
279 | } | ||
285 | 280 | ||
286 | MailViewer { | 281 | MailViewer { |
287 | id: body | 282 | id: body |
288 | |||
289 | anchors { | ||
290 | top: header.bottom | ||
291 | left: parent.left | ||
292 | right: parent.right | ||
293 | leftMargin: avatar.height + Kirigami.Units.gridUnit | ||
294 | rightMargin: avatar.height + Kirigami.Units.gridUnit | ||
295 | topMargin: avatar.height | ||
296 | } | ||
297 | |||
298 | width: header.width - Kirigami.Units.largeSpacing * 2 | ||
299 | height: desiredHeight | ||
300 | 283 | ||
301 | message: model.mimeMessage | 284 | anchors { |
285 | top: header.bottom | ||
286 | left: parent.left | ||
287 | right: parent.right | ||
288 | leftMargin: avatar.height + Kirigami.Units.gridUnit | ||
289 | rightMargin: avatar.height + Kirigami.Units.gridUnit | ||
290 | topMargin: avatar.height | ||
302 | } | 291 | } |
303 | 292 | ||
304 | Item { | 293 | width: header.width - Kirigami.Units.largeSpacing * 2 |
305 | id: footer | 294 | height: desiredHeight |
306 | 295 | ||
307 | anchors.bottom: parent.bottom | 296 | message: model.mimeMessage |
297 | } | ||
308 | 298 | ||
309 | height: Kirigami.Units.gridUnit * 2 | 299 | Item { |
310 | width: parent.width | 300 | id: footer |
311 | 301 | ||
312 | Text { | 302 | anchors.bottom: parent.bottom |
313 | 303 | ||
314 | anchors{ | 304 | height: Kirigami.Units.gridUnit * 2 |
315 | verticalCenter: parent.verticalCenter | 305 | width: parent.width |
316 | left: parent.left | ||
317 | leftMargin: Kirigami.Units.gridUnit | ||
318 | } | ||
319 | 306 | ||
320 | text: "Delete Mail" | 307 | Text { |
321 | color: Kirigami.Theme.textColor | 308 | |
322 | opacity: 0.5 | 309 | anchors{ |
310 | verticalCenter: parent.verticalCenter | ||
311 | left: parent.left | ||
312 | leftMargin: Kirigami.Units.gridUnit | ||
323 | } | 313 | } |
324 | 314 | ||
325 | ToolButton { | 315 | text: "Delete Mail" |
326 | anchors{ | 316 | color: Kirigami.Theme.textColor |
327 | verticalCenter: parent.verticalCenter | 317 | opacity: 0.5 |
328 | right: parent.right | 318 | } |
329 | rightMargin: Kirigami.Units.gridUnit | ||
330 | } | ||
331 | 319 | ||
332 | iconName: "mail-reply-sender" | 320 | ToolButton { |
321 | anchors{ | ||
322 | verticalCenter: parent.verticalCenter | ||
323 | right: parent.right | ||
324 | rightMargin: Kirigami.Units.gridUnit | ||
333 | } | 325 | } |
334 | } | ||
335 | 326 | ||
327 | iconName: "mail-reply-sender" | ||
328 | } | ||
336 | } | 329 | } |
337 | } | 330 | } |
338 | } | 331 | } |