diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-02-20 16:52:00 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-02-20 16:52:00 +0100 |
commit | a0c48081516f8fd6adae16c57a4f851bb139e36d (patch) | |
tree | 04528b7ccd2191a17f36f59b1aaaa9804c8cec9a /components/mail/contents/ui | |
parent | eb5dd31512b26d3240e2d07b29e976270f028297 (diff) | |
download | kube-a0c48081516f8fd6adae16c57a4f851bb139e36d.tar.gz kube-a0c48081516f8fd6adae16c57a4f851bb139e36d.zip |
Normalize the component package structure
Diffstat (limited to 'components/mail/contents/ui')
-rw-r--r-- | components/mail/contents/ui/Mail.qml | 343 | ||||
-rw-r--r-- | components/mail/contents/ui/main.qml | 323 |
2 files changed, 345 insertions, 321 deletions
diff --git a/components/mail/contents/ui/Mail.qml b/components/mail/contents/ui/Mail.qml new file mode 100644 index 00000000..d8f6e787 --- /dev/null +++ b/components/mail/contents/ui/Mail.qml | |||
@@ -0,0 +1,343 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2017 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 | |||
19 | |||
20 | import QtQuick 2.7 | ||
21 | import QtQuick.Controls 1.3 | ||
22 | import QtQuick.Layouts 1.1 | ||
23 | |||
24 | import QtQuick.Controls 2.0 as Controls2 | ||
25 | import org.kde.kirigami 1.0 as Kirigami | ||
26 | |||
27 | import org.kube.framework.actions 1.0 as KubeAction | ||
28 | import org.kube.framework.settings 1.0 as KubeSettings | ||
29 | import org.kube.framework.domain 1.0 as KubeFramework | ||
30 | import org.kube.components 1.0 as KubeComponents | ||
31 | import org.kube.components.accounts 1.0 as KubeAccounts | ||
32 | |||
33 | Controls2.ApplicationWindow { | ||
34 | id: app | ||
35 | |||
36 | //FIXME remove fixed pixel hight | ||
37 | //for now just convinience during testing | ||
38 | height: 1080 * 0.8 | ||
39 | width: 1920 * 0.8 | ||
40 | |||
41 | visible: true | ||
42 | |||
43 | //BEGIN Actions | ||
44 | KubeAction.Context { | ||
45 | id: maillistcontext | ||
46 | property variant mail | ||
47 | property bool isDraft | ||
48 | mail: mailListView.currentMail | ||
49 | isDraft: mailListView.isDraft | ||
50 | } | ||
51 | |||
52 | KubeAction.Action { | ||
53 | id: replyAction | ||
54 | actionId: "org.kde.kube.actions.reply" | ||
55 | context: maillistcontext | ||
56 | } | ||
57 | //END Actions | ||
58 | |||
59 | //BEGIN ActionHandler | ||
60 | KubeAction.ActionHandler { | ||
61 | actionId: "org.kde.kube.actions.reply" | ||
62 | function isReady(context) { | ||
63 | return context.mail ? true : false; | ||
64 | } | ||
65 | |||
66 | function handler(context) { | ||
67 | composer.loadMessage(context.mail, false) | ||
68 | composer.open() | ||
69 | } | ||
70 | } | ||
71 | |||
72 | KubeAction.ActionHandler { | ||
73 | actionId: "org.kde.kube.actions.edit" | ||
74 | function isReady(context) { | ||
75 | return context.mail && context.isDraft; | ||
76 | } | ||
77 | function handler(context) { | ||
78 | composer.loadMessage(context.mail, true) | ||
79 | composer.open() | ||
80 | } | ||
81 | } | ||
82 | //END ActionHandler | ||
83 | |||
84 | //Controller | ||
85 | KubeFramework.MailController { | ||
86 | id: mailController | ||
87 | threadLeader: mailListView.currentMail | ||
88 | } | ||
89 | |||
90 | KubeFramework.FolderController { | ||
91 | id: folderController | ||
92 | folder: folderListView.currentFolder | ||
93 | } | ||
94 | |||
95 | //BEGIN Shortcuts | ||
96 | Shortcut { | ||
97 | sequence: StandardKey.Refresh | ||
98 | onActivated: folderController.synchronizeAction.execute() | ||
99 | enabled: folderController.synchronizeAction.enabled | ||
100 | } | ||
101 | Shortcut { | ||
102 | sequence: StandardKey.Delete | ||
103 | onActivated: mailController.moveToTrashAction.execute() | ||
104 | enabled: mailController.moveToTrashAction.enabled | ||
105 | } | ||
106 | Shortcut { | ||
107 | sequence: StandardKey.MoveToNextLine | ||
108 | onActivated: mailListView.currentIndex++ | ||
109 | } | ||
110 | Shortcut { | ||
111 | sequence: StandardKey.MoveToPreviousLine | ||
112 | onActivated: mailListView.currentIndex-- | ||
113 | } | ||
114 | //END Shortcuts | ||
115 | |||
116 | //BEGIN background | ||
117 | Rectangle { | ||
118 | anchors.fill: parent | ||
119 | |||
120 | color: Kirigami.Theme.backgroundColor | ||
121 | } | ||
122 | //END background | ||
123 | |||
124 | //BEGIN Main content | ||
125 | SplitView { | ||
126 | anchors { | ||
127 | top: app.top | ||
128 | left: app.left | ||
129 | } | ||
130 | |||
131 | height: app.height | ||
132 | width: app.width | ||
133 | |||
134 | Rectangle { | ||
135 | width: Kirigami.Units.gridUnit * 10 | ||
136 | Layout.maximumWidth: app.width * 0.25 | ||
137 | Layout.minimumWidth: Kirigami.Units.gridUnit * 5 | ||
138 | |||
139 | color: Kirigami.Theme.textColor | ||
140 | |||
141 | Controls2.ToolBar { | ||
142 | id: toolBar | ||
143 | |||
144 | anchors { | ||
145 | top: parent.top | ||
146 | left: parent.left | ||
147 | right: parent.right | ||
148 | } | ||
149 | |||
150 | RowLayout { | ||
151 | anchors.centerIn: parent | ||
152 | |||
153 | spacing: Kirigami.Units.largeSpacing | ||
154 | |||
155 | KubeComponents.AccountSwitcher { | ||
156 | id: accountSwitcher | ||
157 | |||
158 | iconName: "kdenlive-menu" | ||
159 | height: Kirigami.Units.gridUnit * 1.5 | ||
160 | width: height | ||
161 | } | ||
162 | |||
163 | ToolButton { | ||
164 | iconName: "user" | ||
165 | height: Kirigami.Units.gridUnit * 1.5 | ||
166 | width: height | ||
167 | |||
168 | onClicked: { | ||
169 | people.open() | ||
170 | } | ||
171 | } | ||
172 | |||
173 | ToolButton { | ||
174 | iconName: "search" | ||
175 | height: Kirigami.Units.gridUnit * 1.5 | ||
176 | width: height | ||
177 | |||
178 | onClicked: { | ||
179 | search.open() | ||
180 | } | ||
181 | } | ||
182 | } | ||
183 | } | ||
184 | |||
185 | Rectangle { | ||
186 | id: newMailButton | ||
187 | |||
188 | anchors { | ||
189 | top: toolBar.bottom | ||
190 | left: parent.left | ||
191 | right: parent.right | ||
192 | margins: Kirigami.Units.largeSpacing | ||
193 | } | ||
194 | |||
195 | color: "#27ae60" | ||
196 | clip: true | ||
197 | |||
198 | height: Kirigami.Units.gridUnit * 1.5 | ||
199 | |||
200 | Text { | ||
201 | anchors.centerIn: parent | ||
202 | |||
203 | text: qsTr("New Email") | ||
204 | color: "white" | ||
205 | } | ||
206 | //iconName: "mail-message-new" | ||
207 | //Controls2.Tooltip.text: "compose new email" | ||
208 | |||
209 | MouseArea { | ||
210 | anchors.fill: parent | ||
211 | onClicked: { | ||
212 | composer.open() | ||
213 | } | ||
214 | } | ||
215 | } | ||
216 | |||
217 | Item { | ||
218 | id: accountName | ||
219 | |||
220 | anchors { | ||
221 | top: newMailButton.bottom | ||
222 | topMargin: Kirigami.Units.smallSpacing | ||
223 | } | ||
224 | |||
225 | width: parent.width | ||
226 | height: Kirigami.Units.gridUnit * 2 | ||
227 | |||
228 | Text { | ||
229 | anchors { | ||
230 | bottom: parent.bottom | ||
231 | left: parent.left | ||
232 | leftMargin: Kirigami.Units.smallSpacing | ||
233 | } | ||
234 | |||
235 | text: accountSwitcher.accountName | ||
236 | font.weight: Font.DemiBold | ||
237 | color: "white" | ||
238 | } | ||
239 | } | ||
240 | |||
241 | KubeComponents.FolderListView { | ||
242 | id: folderListView | ||
243 | |||
244 | anchors { | ||
245 | top: accountName.bottom | ||
246 | topMargin: Kirigami.Units.smallSpacing | ||
247 | bottom: parent.bottom | ||
248 | left: parent.left | ||
249 | right: parent.right | ||
250 | } | ||
251 | |||
252 | focus: true | ||
253 | accountId: accountSwitcher.accountId | ||
254 | } | ||
255 | } | ||
256 | |||
257 | KubeComponents.MailListView { | ||
258 | id: mailListView | ||
259 | parentFolder: folderListView.currentFolder | ||
260 | width: Kirigami.Units.gridUnit * 20 | ||
261 | height: parent.height | ||
262 | Layout.maximumWidth: app.width * 0.4 | ||
263 | Layout.minimumWidth: Kirigami.Units.gridUnit * 10 | ||
264 | focus: true | ||
265 | } | ||
266 | |||
267 | KubeComponents.SingleMailView { | ||
268 | id: mailView | ||
269 | mail: mailListView.currentMail | ||
270 | Layout.fillWidth: true | ||
271 | } | ||
272 | } | ||
273 | //END Main content | ||
274 | |||
275 | //BEGIN Composer | ||
276 | KubeComponents.FocusComposer { | ||
277 | id: composer | ||
278 | |||
279 | height: app.height * 0.85 | ||
280 | width: app.width * 0.85 | ||
281 | |||
282 | x: app.width * 0.075 | ||
283 | y: app.height * 0.075 | ||
284 | } | ||
285 | //END Composer | ||
286 | |||
287 | //BEGIN AccountWizard | ||
288 | KubeAccounts.AccountWizard { | ||
289 | id: accountWizard | ||
290 | |||
291 | height: app.height * 0.85 | ||
292 | width: app.width * 0.85 | ||
293 | |||
294 | x: app.width * 0.075 | ||
295 | y: app.height * 0.075 | ||
296 | } | ||
297 | //END AccountWizard | ||
298 | |||
299 | //BEGIN Search | ||
300 | Controls2.Popup { | ||
301 | id: search | ||
302 | |||
303 | width: app.width * 0.6 | ||
304 | height: Kirigami.Units.gridUnit * 3 | ||
305 | |||
306 | x: app.width * 0.2 | ||
307 | y: app.height * 0.2 | ||
308 | |||
309 | modal: true | ||
310 | focus: true | ||
311 | |||
312 | RowLayout { | ||
313 | anchors.fill: parent | ||
314 | |||
315 | Controls2.TextField { | ||
316 | Layout.fillWidth: true | ||
317 | placeholderText: "Search... is not available in this beta" | ||
318 | } | ||
319 | |||
320 | Controls2.Button { | ||
321 | text: "Go" | ||
322 | |||
323 | onClicked: { | ||
324 | search.close() | ||
325 | } | ||
326 | } | ||
327 | } | ||
328 | } | ||
329 | //END Search | ||
330 | |||
331 | //BEGIN People | ||
332 | KubeComponents.People { | ||
333 | id: people | ||
334 | |||
335 | height: app.height * 0.85 | ||
336 | width: app.width * 0.85 | ||
337 | |||
338 | x: app.width * 0.075 | ||
339 | y: app.height * 0.075 | ||
340 | |||
341 | } | ||
342 | //END People | ||
343 | } | ||
diff --git a/components/mail/contents/ui/main.qml b/components/mail/contents/ui/main.qml index eed80f55..0a1e1d75 100644 --- a/components/mail/contents/ui/main.qml +++ b/components/mail/contents/ui/main.qml | |||
@@ -16,328 +16,9 @@ | |||
16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
17 | */ | 17 | */ |
18 | 18 | ||
19 | |||
20 | import QtQuick 2.7 | 19 | import QtQuick 2.7 |
21 | import QtQuick.Controls 1.3 | 20 | import org.kube.components.Mail 1.0 as MailComponent |
22 | import QtQuick.Layouts 1.1 | ||
23 | |||
24 | import QtQuick.Controls 2.0 as Controls2 | ||
25 | import org.kde.kirigami 1.0 as Kirigami | ||
26 | |||
27 | import org.kube.framework.actions 1.0 as KubeAction | ||
28 | import org.kube.framework.settings 1.0 as KubeSettings | ||
29 | import org.kube.framework.domain 1.0 as KubeFramework | ||
30 | import org.kube.components 1.0 as KubeComponents | ||
31 | import org.kube.accounts 1.0 as KubeAccounts | ||
32 | |||
33 | Controls2.ApplicationWindow { | ||
34 | id: app | ||
35 | |||
36 | //FIXME remove fixed pixel hight | ||
37 | //for now just convinience during testing | ||
38 | height: 1080 * 0.8 | ||
39 | width: 1920 * 0.8 | ||
40 | |||
41 | visible: true | ||
42 | |||
43 | //BEGIN Actions | ||
44 | KubeAction.Context { | ||
45 | id: maillistcontext | ||
46 | property variant mail | ||
47 | property bool isDraft | ||
48 | mail: mailListView.currentMail | ||
49 | isDraft: mailListView.isDraft | ||
50 | } | ||
51 | |||
52 | KubeAction.Action { | ||
53 | id: replyAction | ||
54 | actionId: "org.kde.kube.actions.reply" | ||
55 | context: maillistcontext | ||
56 | } | ||
57 | //END Actions | ||
58 | |||
59 | //BEGIN ActionHandler | ||
60 | KubeAction.ActionHandler { | ||
61 | actionId: "org.kde.kube.actions.reply" | ||
62 | function isReady(context) { | ||
63 | return context.mail ? true : false; | ||
64 | } | ||
65 | |||
66 | function handler(context) { | ||
67 | composer.loadMessage(context.mail, false) | ||
68 | composer.open() | ||
69 | } | ||
70 | } | ||
71 | |||
72 | KubeAction.ActionHandler { | ||
73 | actionId: "org.kde.kube.actions.edit" | ||
74 | function isReady(context) { | ||
75 | return context.mail && context.isDraft; | ||
76 | } | ||
77 | function handler(context) { | ||
78 | composer.loadMessage(context.mail, true) | ||
79 | composer.open() | ||
80 | } | ||
81 | } | ||
82 | //END ActionHandler | ||
83 | |||
84 | //Controller | ||
85 | KubeFramework.MailController { | ||
86 | id: mailController | ||
87 | threadLeader: mailListView.currentMail | ||
88 | } | ||
89 | |||
90 | KubeFramework.FolderController { | ||
91 | id: folderController | ||
92 | folder: folderListView.currentFolder | ||
93 | } | ||
94 | |||
95 | //BEGIN Shortcuts | ||
96 | Shortcut { | ||
97 | sequence: StandardKey.Refresh | ||
98 | onActivated: folderController.synchronizeAction.execute() | ||
99 | enabled: folderController.synchronizeAction.enabled | ||
100 | } | ||
101 | Shortcut { | ||
102 | sequence: StandardKey.Delete | ||
103 | onActivated: mailController.moveToTrashAction.execute() | ||
104 | enabled: mailController.moveToTrashAction.enabled | ||
105 | } | ||
106 | Shortcut { | ||
107 | sequence: StandardKey.MoveToNextLine | ||
108 | onActivated: mailListView.currentIndex++ | ||
109 | } | ||
110 | Shortcut { | ||
111 | sequence: StandardKey.MoveToPreviousLine | ||
112 | onActivated: mailListView.currentIndex-- | ||
113 | } | ||
114 | //END Shortcuts | ||
115 | |||
116 | //BEGIN background | ||
117 | Rectangle { | ||
118 | anchors.fill: parent | ||
119 | |||
120 | color: Kirigami.Theme.backgroundColor | ||
121 | } | ||
122 | //END background | ||
123 | |||
124 | //BEGIN Main content | ||
125 | SplitView { | ||
126 | anchors { | ||
127 | top: app.top | ||
128 | left: app.left | ||
129 | } | ||
130 | |||
131 | height: app.height | ||
132 | width: app.width | ||
133 | |||
134 | Rectangle { | ||
135 | width: Kirigami.Units.gridUnit * 10 | ||
136 | Layout.maximumWidth: app.width * 0.25 | ||
137 | Layout.minimumWidth: Kirigami.Units.gridUnit * 5 | ||
138 | |||
139 | color: Kirigami.Theme.textColor | ||
140 | |||
141 | Controls2.ToolBar { | ||
142 | id: toolBar | ||
143 | |||
144 | anchors { | ||
145 | top: parent.top | ||
146 | left: parent.left | ||
147 | right: parent.right | ||
148 | } | ||
149 | |||
150 | RowLayout { | ||
151 | anchors.centerIn: parent | ||
152 | |||
153 | spacing: Kirigami.Units.largeSpacing | ||
154 | |||
155 | KubeComponents.AccountSwitcher { | ||
156 | id: accountSwitcher | ||
157 | |||
158 | iconName: "kdenlive-menu" | ||
159 | height: Kirigami.Units.gridUnit * 1.5 | ||
160 | width: height | ||
161 | } | ||
162 | |||
163 | ToolButton { | ||
164 | iconName: "user" | ||
165 | height: Kirigami.Units.gridUnit * 1.5 | ||
166 | width: height | ||
167 | |||
168 | onClicked: { | ||
169 | people.open() | ||
170 | } | ||
171 | } | ||
172 | |||
173 | ToolButton { | ||
174 | iconName: "search" | ||
175 | height: Kirigami.Units.gridUnit * 1.5 | ||
176 | width: height | ||
177 | |||
178 | onClicked: { | ||
179 | search.open() | ||
180 | } | ||
181 | } | ||
182 | } | ||
183 | } | ||
184 | |||
185 | Rectangle { | ||
186 | id: newMailButton | ||
187 | |||
188 | anchors { | ||
189 | top: toolBar.bottom | ||
190 | left: parent.left | ||
191 | right: parent.right | ||
192 | margins: Kirigami.Units.largeSpacing | ||
193 | } | ||
194 | |||
195 | color: "#27ae60" | ||
196 | clip: true | ||
197 | |||
198 | height: Kirigami.Units.gridUnit * 1.5 | ||
199 | |||
200 | Text { | ||
201 | anchors.centerIn: parent | ||
202 | |||
203 | text: qsTr("New Email") | ||
204 | color: "white" | ||
205 | } | ||
206 | //iconName: "mail-message-new" | ||
207 | //Controls2.Tooltip.text: "compose new email" | ||
208 | |||
209 | MouseArea { | ||
210 | anchors.fill: parent | ||
211 | onClicked: { | ||
212 | composer.open() | ||
213 | } | ||
214 | } | ||
215 | } | ||
216 | |||
217 | Item { | ||
218 | id: accountName | ||
219 | |||
220 | anchors { | ||
221 | top: newMailButton.bottom | ||
222 | topMargin: Kirigami.Units.smallSpacing | ||
223 | } | ||
224 | |||
225 | width: parent.width | ||
226 | height: Kirigami.Units.gridUnit * 2 | ||
227 | |||
228 | Text { | ||
229 | anchors { | ||
230 | bottom: parent.bottom | ||
231 | left: parent.left | ||
232 | leftMargin: Kirigami.Units.smallSpacing | ||
233 | } | ||
234 | |||
235 | text: accountSwitcher.accountName | ||
236 | font.weight: Font.DemiBold | ||
237 | color: "white" | ||
238 | } | ||
239 | } | ||
240 | |||
241 | KubeComponents.FolderListView { | ||
242 | id: folderListView | ||
243 | |||
244 | anchors { | ||
245 | top: accountName.bottom | ||
246 | topMargin: Kirigami.Units.smallSpacing | ||
247 | bottom: parent.bottom | ||
248 | left: parent.left | ||
249 | right: parent.right | ||
250 | } | ||
251 | |||
252 | focus: true | ||
253 | accountId: accountSwitcher.accountId | ||
254 | } | ||
255 | } | ||
256 | |||
257 | KubeComponents.MailListView { | ||
258 | id: mailListView | ||
259 | parentFolder: folderListView.currentFolder | ||
260 | width: Kirigami.Units.gridUnit * 20 | ||
261 | height: parent.height | ||
262 | Layout.maximumWidth: app.width * 0.4 | ||
263 | Layout.minimumWidth: Kirigami.Units.gridUnit * 10 | ||
264 | focus: true | ||
265 | } | ||
266 | |||
267 | KubeComponents.SingleMailView { | ||
268 | id: mailView | ||
269 | mail: mailListView.currentMail | ||
270 | Layout.fillWidth: true | ||
271 | } | ||
272 | } | ||
273 | //END Main content | ||
274 | |||
275 | //BEGIN Composer | ||
276 | KubeComponents.FocusComposer { | ||
277 | id: composer | ||
278 | |||
279 | height: app.height * 0.85 | ||
280 | width: app.width * 0.85 | ||
281 | |||
282 | x: app.width * 0.075 | ||
283 | y: app.height * 0.075 | ||
284 | } | ||
285 | //END Composer | ||
286 | |||
287 | //BEGIN AccountWizard | ||
288 | KubeAccounts.AccountWizard { | ||
289 | id: accountWizard | ||
290 | |||
291 | height: app.height * 0.85 | ||
292 | width: app.width * 0.85 | ||
293 | |||
294 | x: app.width * 0.075 | ||
295 | y: app.height * 0.075 | ||
296 | } | ||
297 | //END AccountWizard | ||
298 | |||
299 | //BEGIN Search | ||
300 | Controls2.Popup { | ||
301 | id: search | ||
302 | |||
303 | width: app.width * 0.6 | ||
304 | height: Kirigami.Units.gridUnit * 3 | ||
305 | |||
306 | x: app.width * 0.2 | ||
307 | y: app.height * 0.2 | ||
308 | |||
309 | modal: true | ||
310 | focus: true | ||
311 | |||
312 | RowLayout { | ||
313 | anchors.fill: parent | ||
314 | |||
315 | Controls2.TextField { | ||
316 | Layout.fillWidth: true | ||
317 | placeholderText: "Search... is not available in this beta" | ||
318 | } | ||
319 | |||
320 | Controls2.Button { | ||
321 | text: "Go" | ||
322 | |||
323 | onClicked: { | ||
324 | search.close() | ||
325 | } | ||
326 | } | ||
327 | } | ||
328 | } | ||
329 | //END Search | ||
330 | |||
331 | //BEGIN People | ||
332 | KubeComponents.People { | ||
333 | id: people | ||
334 | |||
335 | height: app.height * 0.85 | ||
336 | width: app.width * 0.85 | ||
337 | 21 | ||
338 | x: app.width * 0.075 | 22 | MailComponent.Mail { |
339 | y: app.height * 0.075 | ||
340 | 23 | ||
341 | } | ||
342 | //END People | ||
343 | } | 24 | } |