diff options
Diffstat (limited to 'applications/kube-mail/package/contents/ui/MailListView.qml')
-rw-r--r-- | applications/kube-mail/package/contents/ui/MailListView.qml | 155 |
1 files changed, 0 insertions, 155 deletions
diff --git a/applications/kube-mail/package/contents/ui/MailListView.qml b/applications/kube-mail/package/contents/ui/MailListView.qml deleted file mode 100644 index ff773e0e..00000000 --- a/applications/kube-mail/package/contents/ui/MailListView.qml +++ /dev/null | |||
@@ -1,155 +0,0 @@ | |||
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 | |||
18 | import QtQuick 2.4 | ||
19 | import QtQuick.Controls 1.4 | ||
20 | import QtQuick.Layouts 1.1 | ||
21 | |||
22 | import QtQml 2.2 | ||
23 | |||
24 | import org.kde.plasma.components 2.0 as PlasmaComponents | ||
25 | |||
26 | import org.kde.kube.mail 1.0 as Mail | ||
27 | |||
28 | ScrollView { | ||
29 | id: root | ||
30 | property variant parentFolder | ||
31 | property variant currentMail | ||
32 | |||
33 | ListView { | ||
34 | id: listView | ||
35 | |||
36 | model: Mail.MailListModel { | ||
37 | parentFolder: root.parentFolder | ||
38 | } | ||
39 | |||
40 | Keys.onDownPressed: { | ||
41 | incrementCurrentIndex() | ||
42 | } | ||
43 | Keys.onUpPressed: { | ||
44 | decrementCurrentIndex() | ||
45 | } | ||
46 | focus: true | ||
47 | |||
48 | delegate: PlasmaComponents.ListItem { | ||
49 | width: listView.width | ||
50 | height: unit.size * 12 | ||
51 | |||
52 | enabled: true | ||
53 | checked: listView.currentIndex == index | ||
54 | |||
55 | Binding { | ||
56 | target: root | ||
57 | property: "currentMail" | ||
58 | when: listView.currentIndex == index | ||
59 | value: model.domainObject | ||
60 | } | ||
61 | |||
62 | MouseArea { | ||
63 | anchors.fill: parent | ||
64 | |||
65 | onClicked: { | ||
66 | listView.currentIndex = model.index | ||
67 | } | ||
68 | } | ||
69 | |||
70 | Rectangle { | ||
71 | id: unread | ||
72 | |||
73 | anchors.fill: parent | ||
74 | |||
75 | // color: colorPalette.read | ||
76 | color: "steelblue" | ||
77 | opacity: 0.1 | ||
78 | |||
79 | visible: model.unread | ||
80 | } | ||
81 | |||
82 | Avatar { | ||
83 | id: avatar | ||
84 | |||
85 | anchors { | ||
86 | verticalCenter: parent.verticalCenter | ||
87 | left: parent.left | ||
88 | leftMargin: unit.size * 2 | ||
89 | } | ||
90 | |||
91 | height: unit.size * 9 | ||
92 | width: height | ||
93 | |||
94 | name: model.senderName | ||
95 | } | ||
96 | |||
97 | Label { | ||
98 | id: senderName | ||
99 | |||
100 | anchors { | ||
101 | top: avatar.top | ||
102 | left: avatar.right | ||
103 | leftMargin: unit.size * 3 | ||
104 | } | ||
105 | |||
106 | text: model.senderName | ||
107 | |||
108 | font.weight: Font.DemiBold | ||
109 | } | ||
110 | |||
111 | //The name currently contains both name and address | ||
112 | // Label { | ||
113 | // id: sender | ||
114 | // | ||
115 | // anchors { | ||
116 | // top: avatar.top | ||
117 | // left: senderName.right | ||
118 | // leftMargin: unit.size | ||
119 | // right: date.left | ||
120 | // rightMargin: unit.size | ||
121 | // } | ||
122 | // | ||
123 | // text: "(" + model.sender +")" | ||
124 | // | ||
125 | // clip: true | ||
126 | // } | ||
127 | |||
128 | Label { | ||
129 | id: date | ||
130 | |||
131 | anchors { | ||
132 | top: avatar.top | ||
133 | right: parent.right | ||
134 | rightMargin: unit.size * 2 | ||
135 | } | ||
136 | |||
137 | text: Qt.formatDateTime(model.date) | ||
138 | |||
139 | font.weight: Font.Light | ||
140 | } | ||
141 | |||
142 | Label { | ||
143 | id: subject | ||
144 | |||
145 | anchors { | ||
146 | bottom: avatar.bottom | ||
147 | left: avatar.right | ||
148 | leftMargin: unit.size * 3 | ||
149 | } | ||
150 | |||
151 | text: model.subject | ||
152 | } | ||
153 | } | ||
154 | } | ||
155 | } | ||