summaryrefslogtreecommitdiffstats
path: root/applications/kube-mail/package/contents/ui/MailListView.qml
diff options
context:
space:
mode:
Diffstat (limited to 'applications/kube-mail/package/contents/ui/MailListView.qml')
-rw-r--r--applications/kube-mail/package/contents/ui/MailListView.qml131
1 files changed, 131 insertions, 0 deletions
diff --git a/applications/kube-mail/package/contents/ui/MailListView.qml b/applications/kube-mail/package/contents/ui/MailListView.qml
new file mode 100644
index 00000000..f6ded917
--- /dev/null
+++ b/applications/kube-mail/package/contents/ui/MailListView.qml
@@ -0,0 +1,131 @@
1/*
2 * Copyright (C) 2015 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 3 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
15 * along with this program; if not, see <http://www.gnu.org/licenses/>.
16 */
17
18import QtQuick 2.4
19import QtQuick.Controls 1.3
20import QtQuick.Layouts 1.1
21
22import org.kde.plasma.components 2.0 as PlasmaComponents
23
24ScrollView {
25 id: root
26 ListView {
27 id: listView
28
29 model: mailList.model //MailListModel {}
30
31 delegate: PlasmaComponents.ListItem {
32
33 width: listView.width
34 height: unit.size * 12
35
36 enabled: true
37 checked: listView.currentIndex == index
38
39 MouseArea {
40 anchors.fill: parent
41
42 onClicked: {
43 listView.currentIndex = model.index
44 singleMail.loadMail(model.id)
45 }
46 }
47
48 Rectangle {
49 id: unread
50
51 anchors.fill: parent
52
53 color: colorPalette.read
54 opacity: 0.1
55
56 visible: model.unread == false
57 }
58
59 Avatar {
60 id: avatar
61
62 anchors {
63 verticalCenter: parent.verticalCenter
64 left: parent.left
65 leftMargin: unit.size * 2
66 }
67
68 height: unit.size * 9
69 width: height
70
71 name: model.senderName
72 }
73
74 Label {
75 id: senderName
76
77 anchors {
78 top: avatar.top
79 left: avatar.right
80 leftMargin: unit.size * 3
81 }
82
83 text: model.senderName
84
85 font.weight: Font.DemiBold
86 }
87
88 Label {
89 id: sender
90
91 anchors {
92 top: avatar.top
93 left: senderName.right
94 leftMargin: unit.size
95 right: date.left
96 rightMargin: unit.size
97 }
98
99 text: "(" + model.sender +")"
100
101 clip: true
102 }
103
104 Label {
105 id: date
106
107 anchors {
108 top: avatar.top
109 right: parent.right
110 rightMargin: unit.size * 2
111 }
112
113 text: model.date
114
115 font.weight: Font.Light
116 }
117
118 Label {
119 id: subject
120
121 anchors {
122 bottom: avatar.bottom
123 left: avatar.right
124 leftMargin: unit.size * 3
125 }
126
127 text: model.subject
128 }
129 }
130 }
131} \ No newline at end of file