summaryrefslogtreecommitdiffstats
path: root/components/package
diff options
context:
space:
mode:
Diffstat (limited to 'components/package')
-rw-r--r--components/package/contents/ui/SingleMailView.qml176
1 files changed, 149 insertions, 27 deletions
diff --git a/components/package/contents/ui/SingleMailView.qml b/components/package/contents/ui/SingleMailView.qml
index 4b801a89..4f434edc 100644
--- a/components/package/contents/ui/SingleMailView.qml
+++ b/components/package/contents/ui/SingleMailView.qml
@@ -18,57 +18,179 @@
18import QtQuick 2.4 18import QtQuick 2.4
19import QtQuick.Controls 1.3 19import QtQuick.Controls 1.3
20import QtQuick.Layouts 1.1 20import QtQuick.Layouts 1.1
21import org.kde.kirigami 1.0 as Kirigami
21 22
22import org.kube.framework.domain 1.0 as KubeFramework 23import org.kube.framework.domain 1.0 as KubeFramework
23import org.kube.framework.theme 1.0 24import org.kube.framework.theme 1.0
24 25
25Item { 26Rectangle {
26 id: root 27 id: root
27 property variant mail; 28 property variant mail;
28 29
29 Rectangle { 30 color: "grey"
30 id: background
31 31
32 ScrollView {
32 anchors.fill: parent 33 anchors.fill: parent
33 34
34 color: ColorPalette.background 35 ListView {
35 } 36 anchors.verticalCenter: parent.verticalCenter
36 37
37 Repeater { 38 width: parent.width
38 anchors.fill: parent 39
40 header: Item {
41 height: Kirigami.Units.largeSpacing
42 }
43
44 footer: Item {
45 height: Kirigami.Units.largeSpacing * 3
46 }
39 47
40 model: KubeFramework.MailListModel { 48 model: KubeFramework.MailListModel {
41 mail: root.mail 49 mail: root.mail
42 } 50 }
43 51
44 delegate: Item { 52 delegate: Item {
45 anchors.fill: parent
46 53
47 ColumnLayout { 54 width: root.width
48 anchors.fill: parent 55 implicitHeight: content.height
49 56
50 Label { 57 Rectangle {
51 text: model.id 58 id: content
52 } 59 anchors.centerIn: parent
53 60
54 Label { 61 width: parent.width * 0.9
55 text: model.sender 62 implicitHeight: header.height + body.height + footer.height + Kirigami.Units.gridUnit * 8
56 }
57 63
58 Label { 64 Item {
59 text: model.senderName 65 id: header
60 }
61 66
62 Label { 67 anchors {
63 text: model.subject 68 top: parent.top
64 } 69 topMargin: Kirigami.Units.largeSpacing
70 horizontalCenter: parent.horizontalCenter
71 }
65 72
66 MailViewer { 73 width: parent.width - Kirigami.Units.largeSpacing * 2
67 message: model.mimeMessage 74 height: Kirigami.Units.gridUnit * 6
68 Layout.fillHeight: true 75
69 Layout.fillWidth: true 76
70 } 77 Avatar {
78 id: avatar
79
80 height: Kirigami.Units.gridUnit * 4
81 width: height
82
83 name: model.senderName
84 }
85
86 Text {
87
88 anchors {
89 bottom: parent.bottom
90 left: parent.left
91 bottomMargin: Kirigami.Units.smallSpacing
92 }
93
94 text: model.subject
95 renderType: Text.NativeRendering
96 color: Kirigami.Theme.textColor
97 }
98
99 Text {
100
101 anchors {
102 top: avatar.top
103 left: avatar.right
104 leftMargin: Kirigami.Units.smallSpacing
105 }
106
107 text: model.senderName
108
109 renderType: Text.NativeRendering
110 color: Kirigami.Theme.textColor
111 }
71 112
113 Text {
114
115 anchors {
116 right: parent.right
117 }
118 text: Qt.formatDateTime(model.date)
119
120 renderType: Text.NativeRendering
121 color: Kirigami.Theme.textColor
122 }
123
124 Rectangle {
125
126 anchors {
127 bottom: border.top
128 right: border.right
129 }
130
131 height: Kirigami.Units.iconSizes.small
132 width: height
133
134 color: Kirigami.Theme.complementaryBackgroundColor
135 opacity: 0.5
136 }
137
138 Rectangle {
139 id: border
140
141 anchors.bottom: parent.bottom
142 width: parent.width
143 height: 1
144
145 color: Kirigami.Theme.complementaryBackgroundColor
146
147 opacity: 0.5
148 }
149 }
150
151 Text {
152 id: body
153
154 anchors {
155 top: header.bottom
156 topMargin: Kirigami.Units.largeSpacing * 2
157 left: header.left
158 leftMargin: Kirigami.Units.largeSpacing
159 }
160
161 width: header.width - Kirigami.Units.largeSpacing * 2
162
163 text: model.mimeMessage
164
165 clip: true
166 wrapMode: Text.WordWrap
167 renderType: Text.NativeRendering
168 color: Kirigami.Theme.textColor
169 }
170
171 /*
172 MailViewer {
173 message: model.mimeMessage
174 }
175 */
176
177 Item {
178 id: footer
179
180 anchors {
181 bottom: parent.bottom
182 bottomMargin: Kirigami.Units.largeSpacing
183 horizontalCenter: parent.horizontalCenter
184 }
185
186 width: header.width
187 height: Kirigami.Units.gridUnit
188
189 ToolButton {
190 text: "Delete Email"
191 }
192 }
193 }
72 } 194 }
73 } 195 }
74 } 196 }