summaryrefslogtreecommitdiffstats
path: root/components/mailviewer/qml/MailViewer.qml
diff options
context:
space:
mode:
authorSandro Knauß <sknauss@kde.org>2016-10-19 14:28:08 +0200
committerSandro Knauß <sknauss@kde.org>2016-10-19 14:28:08 +0200
commit6833c46a9522be3c55cefe79676293a0a571cbf5 (patch)
tree6a91b7e00cff34aec70341c24921fd9a1dd095ea /components/mailviewer/qml/MailViewer.qml
parentbe38c2ebaa77b116028cbe34f777e3d8e5cbc776 (diff)
downloadkube-6833c46a9522be3c55cefe79676293a0a571cbf5.tar.gz
kube-6833c46a9522be3c55cefe79676293a0a571cbf5.zip
use treemodel in qml
Diffstat (limited to 'components/mailviewer/qml/MailViewer.qml')
-rw-r--r--components/mailviewer/qml/MailViewer.qml52
1 files changed, 19 insertions, 33 deletions
diff --git a/components/mailviewer/qml/MailViewer.qml b/components/mailviewer/qml/MailViewer.qml
index f5714e25..86a96913 100644
--- a/components/mailviewer/qml/MailViewer.qml
+++ b/components/mailviewer/qml/MailViewer.qml
@@ -19,42 +19,28 @@
19import QtQuick 2.4 19import QtQuick 2.4
20 20
21Item { 21Item {
22 id: mailviewer 22 id: root
23 height: mainColumn.height + 50 23 property alias rootIndex: visualModel.rootIndex
24 property bool debug: true
25 height: partListView.height + 50
24 width: parent.width * 0.9 26 width: parent.width * 0.9
25 27
26 Column { 28 MailDataModel {
27 id: mainColumn 29 id: visualModel
28 anchors { 30 debug: root.debug
29 top: parent.top 31 model: messageParser.newTree
30 left: parent.left 32 }
31 right: parent.right
32 margins: 20
33 }
34 spacing: 10
35 width: parent.width - 50
36
37 Repeater {
38 model: messageParser.newTree
39
40 delegate: Column {
41 id: delegateRoot
42
43 width: mainColumn.width
44
45 Loader {
46 id: loader
47 }
48 33
49 Component.onCompleted: { 34 ListView {
50 switch (model.type) { 35 id: partListView
51 case "AlternativePart": 36 model: visualModel
52 case "SinglePart": 37 anchors {
53 loader.source = "MailPart.qml"; 38 top: parent.top
54 break; 39 left: parent.left
55 } 40 margins: 5
56 }
57 }
58 } 41 }
42 spacing: 5
43 height: contentHeight
44 width: parent.width - 10
59 } 45 }
60} 46}