summaryrefslogtreecommitdiffstats
path: root/components/package/contents/ui/MessagePartTree.qml
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2017-02-28 18:09:48 +0100
committerChristian Mollekopf <chrigi_1@fastmail.fm>2017-02-28 18:09:48 +0100
commit31fc464ee7a2f6a34bbfec77a551721a6b334b5f (patch)
treecfd79edeb6eb1cc2636d0ef9af6f47fe82358f1f /components/package/contents/ui/MessagePartTree.qml
parentbd4caf4e8d3b525848e542f367c535c5b6a0a101 (diff)
downloadkube-31fc464ee7a2f6a34bbfec77a551721a6b334b5f.tar.gz
kube-31fc464ee7a2f6a34bbfec77a551721a6b334b5f.zip
Removed the old mailviewer.
That way I also don't try to edit outdated invisible components to fix bugs...
Diffstat (limited to 'components/package/contents/ui/MessagePartTree.qml')
-rw-r--r--components/package/contents/ui/MessagePartTree.qml89
1 files changed, 0 insertions, 89 deletions
diff --git a/components/package/contents/ui/MessagePartTree.qml b/components/package/contents/ui/MessagePartTree.qml
deleted file mode 100644
index a904f42c..00000000
--- a/components/package/contents/ui/MessagePartTree.qml
+++ /dev/null
@@ -1,89 +0,0 @@
1/*
2 Copyright (C) 2016 Michael Bohlender, <michael.bohlender@kdemail.net>
3
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
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
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.,
16 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17*/
18
19import QtQuick 2.4
20import QtQuick.Controls 1.3
21
22Item {
23 id: root
24 property alias rootIndex: visualModel.rootIndex
25 property int nestingLevel: 0
26 property int contentHeight: messagePartRect.height
27 property int contentWidth: 0
28 Rectangle {
29 id: messagePartRect
30 height: partListView.contentHeight
31 width: root.width
32 VisualDataModel {
33 id: visualModel
34 model: messageParser.partTree
35 delegate: Rectangle {
36 id: delegateRect
37 visible: !model.isHidden
38 width: childrenRect.width
39 height: childrenRect.height
40 // color: Qt.rgba(Math.random(),Math.random(),Math.random(),1)
41 ContentView {
42 id: contentView
43 anchors.top: delegateRect.top
44 anchors.left: delegateRect.left
45 width: messagePartRect.width
46 height: contentHeight
47 content: model.text
48 isHtml: model.isHtml
49 visible: model.hasContent
50 onVisibleChanged: {
51 //Resize to 0 if it is not visible so the partLoader has the right offset
52 if (!visible) {
53 height = 0
54 }
55 }
56 onContentWidthChanged: {
57 root.contentWidth = contentWidth > root.contentWidth ? contentWidth : root.contentWidth
58 }
59 contentType: model.type
60 }
61 Loader {
62 id: partLoader
63 anchors.top: contentView.bottom
64 anchors.left: contentView.left
65 visible: model.hasModelChildren
66 active: model.hasModelChildren
67 height: item ? item.contentHeight : 0
68 width: messagePartRect.width
69 }
70 Component.onCompleted: {
71 if (model.hasModelChildren) {
72 partLoader.source = "MessagePartTree.qml"
73 partLoader.item.rootIndex = visualModel.modelIndex(index)
74 partLoader.item.nestingLevel = root.nestingLevel + 1
75 }
76 }
77 }
78 }
79
80 ListView {
81 id: partListView
82 model: visualModel
83 anchors.left: parent.left
84 anchors.top: parent.top
85 anchors.right: parent.right
86 height: parent.height
87 }
88 }
89}