summaryrefslogtreecommitdiffstats
path: root/components
diff options
context:
space:
mode:
authorMichael Bohlender <michael.bohlender@kdemail.net>2017-01-09 16:38:55 +0100
committerMichael Bohlender <michael.bohlender@kdemail.net>2017-01-09 16:38:55 +0100
commitebe946c66ce8a251ac98583dbebe33a75eab5480 (patch)
tree01263231d1d9d1df6adf4bc4f3c6acd439e15597 /components
parentca5cdbd3076b5fdc6890c08a1abf8619203a73e4 (diff)
downloadkube-ebe946c66ce8a251ac98583dbebe33a75eab5480.tar.gz
kube-ebe946c66ce8a251ac98583dbebe33a75eab5480.zip
remove app toolbar and move toolbuttons into the columns
Diffstat (limited to 'components')
-rw-r--r--components/mail/contents/ui/main.qml213
-rw-r--r--components/package/contents/ui/AccountSwitcher.qml7
-rw-r--r--components/package/contents/ui/MailListView.qml61
3 files changed, 112 insertions, 169 deletions
diff --git a/components/mail/contents/ui/main.qml b/components/mail/contents/ui/main.qml
index 252cac5b..20fa25c1 100644
--- a/components/mail/contents/ui/main.qml
+++ b/components/mail/contents/ui/main.qml
@@ -125,191 +125,82 @@ Controls2.ApplicationWindow {
125 //BEGIN Main content 125 //BEGIN Main content
126 SplitView { 126 SplitView {
127 anchors { 127 anchors {
128 top: toolbar.bottom 128 top: app.top
129 left: app.left 129 left: app.left
130 } 130 }
131 131
132 height: app.height - toolbar.height 132 height: app.height
133 width: app.width 133 width: app.width
134 134
135 KubeComponents.FolderListView { 135 Rectangle {
136 id: folderListView
137 width: Kirigami.Units.gridUnit * 10 136 width: Kirigami.Units.gridUnit * 10
138 Layout.maximumWidth: app.width * 0.25 137 Layout.maximumWidth: app.width * 0.25
139 Layout.minimumWidth: Kirigami.Units.gridUnit * 5 138 Layout.minimumWidth: Kirigami.Units.gridUnit * 5
140 focus: true
141 accountId: accountSwitcher.accountId
142 }
143
144 KubeComponents.MailListView {
145 id: mailListView
146 parentFolder: folderListView.currentFolder
147 width: Kirigami.Units.gridUnit * 20
148 height: parent.height
149 Layout.maximumWidth: app.width * 0.4
150 Layout.minimumWidth: Kirigami.Units.gridUnit * 10
151 focus: true
152 }
153
154 KubeComponents.SingleMailView {
155 id: mailView
156 mail: mailListView.currentMail
157 Layout.fillWidth: true
158 }
159 }
160 //END Main content
161
162 //BEGIN Toolbar
163 Controls2.ToolBar {
164 id: toolbar
165
166 anchors {
167 top: app.top
168 }
169
170 width: app.width
171 height: Kirigami.Units.iconSizes.medium + Kirigami.Units.smallSpacing * 2
172 139
173 Row { 140 color: Kirigami.Theme.textColor
174 width: parent.width
175 height: parent.height
176
177 spacing: 1 //to account for the SplitView borders
178 141
179 //BEGIN Folderlist section 142 Controls2.Button {
180 RowLayout { 143 id: newMailButton
181 height: parent.height
182 width: folderListView.width - 5 //to adjust for the toolbar spacing
183 144
184 KubeComponents.AccountSwitcher { 145 anchors {
185 id: accountSwitcher 146 top: parent.top
186 } 147 left: parent.left
187 } 148 right: parent.right
188 //END Folderlist section 149 margins: Kirigami.Units.smallSpacing
189
190 //BEGIN MailList section
191 Item {
192
193 height: parent.height
194 width: mailListView.width
195
196 Row {
197 anchors.centerIn: parent
198
199 spacing: Kirigami.Units.smallSpacing
200
201 ToolButton {
202 iconName: "mail-mark-unread"
203 text: qsTr("Mark As Read")
204 enabled: mailController.markAsReadAction.enabled
205 tooltip: qsTr("mark mail as read")
206 onClicked: {
207 mailController.markAsReadAction.execute()
208 }
209 }
210
211 ToolButton {
212 iconName: "mail-mark-important"
213 text: qsTr("Mark Important")
214 enabled: mailController.markAsImportantAction.enabled
215 tooltip: qsTr("mark mail as important")
216 onClicked: {
217 mailController.markAsImportantAction.execute()
218 }
219 }
220
221 ToolButton {
222 iconName: "edit-delete"
223 text: qsTr("Delete Mail")
224 enabled: mailController.moveToTrashAction.enabled
225 tooltip: qsTr("delete email")
226 onClicked: {
227 mailController.moveToTrashAction.execute()
228 }
229 }
230
231 ToolButton {
232 iconName: "edit-undo"
233 text: qsTr("Restore Mail")
234 enabled: mailController.restoreFromTrashAction.enabled
235 tooltip: qsTr("restore email")
236 onClicked: {
237 mailController.restoreFromTrashAction.execute()
238 }
239 }
240 } 150 }
241 }
242 //END MailList section
243 151
244 //BEGIN MailView sections 152 height: Kirigami.Units.gridUnit * 1.5
245 RowLayout{
246 153
247 height: parent.height 154 text: " " + qsTr("New Email") + " "
248 width: mailView.width 155 //iconName: "mail-message-new"
156 //Controls2.Tooltip.text: "compose new email"
249 157
250 Item { 158 onClicked: {
251 width: Kirigami.Units.smallSpacing 159 composer.open()
252 height: width
253 } 160 }
161 }
254 162
255 Controls2.Button { 163 KubeComponents.FolderListView {
256 id: newMailButton 164 id: folderListView
257
258
259 height: toolbar.height
260
261 //iconName: "mail-message-new"
262 text: " " + qsTr("New Email") + " "
263 //Controls2.Tooltip.text: "compose new email"
264 onClicked: {
265 composer.open()
266 }
267 }
268 165
269 KubeComponents.Outbox { 166 anchors {
270 } 167 top: newMailButton.bottom
271/* 168 bottom: accountSwitcher.top
272 ToolButton { 169 left: parent.left
273 iconName: "mail-message-reply" 170 right: parent.right
274 text: "Reply" 171 topMargin: Kirigami.Units.smallSpacing
275 enabled: replyAction.ready
276 onClicked: {
277 replyAction.execute()
278 }
279 } 172 }
280 173
281 174 focus: true
282 * ToolButton { 175 accountId: accountSwitcher.accountId
283 * iconName: "mail-message-edit"
284 * text: "Edit"
285 * enabled: editAction.ready
286 * onClicked: {
287 * editAction.execute()
288 }
289 } 176 }
290 */ 177 KubeComponents.AccountSwitcher {
291 178 id: accountSwitcher
292 Item {
293 Layout.fillWidth: true
294 }
295 179
296 Controls2.TextField { 180 anchors.bottom: parent.bottom
297 id: searchBar
298 181
299 Layout.minimumWidth: Kirigami.Units.gridUnit * 19 182 width: parent.width
300 height: toolbar.height 183 height: Kirigami.Units.gridUnit * 2
184 }
185 }
301 186
302 placeholderText: "Search..." 187 KubeComponents.MailListView {
303 } 188 id: mailListView
189 parentFolder: folderListView.currentFolder
190 width: Kirigami.Units.gridUnit * 20
191 height: parent.height
192 Layout.maximumWidth: app.width * 0.4
193 Layout.minimumWidth: Kirigami.Units.gridUnit * 10
194 focus: true
195 }
304 196
305 Item { 197 KubeComponents.SingleMailView {
306 width: Kirigami.Units.smallSpacing 198 id: mailView
307 } 199 mail: mailListView.currentMail
308 } 200 Layout.fillWidth: true
309 //END MailView section
310 } 201 }
311 } 202 }
312 //END ToolBar 203 //END Main content
313 204
314 //BEGIN Composer 205 //BEGIN Composer
315 KubeComponents.FocusComposer { 206 KubeComponents.FocusComposer {
@@ -319,7 +210,7 @@ Controls2.ApplicationWindow {
319 width: app.width * 0.85 210 width: app.width * 0.85
320 211
321 x: app.width * 0.075 212 x: app.width * 0.075
322 y: toolbar.y + toolbar.height 213 y: app.height * 0.075
323 } 214 }
324 //END Composer 215 //END Composer
325 216
@@ -327,13 +218,11 @@ Controls2.ApplicationWindow {
327 KubeAccounts.AccountWizard { 218 KubeAccounts.AccountWizard {
328 id: accountWizard 219 id: accountWizard
329 220
330 // visible: true
331
332 height: app.height * 0.85 221 height: app.height * 0.85
333 width: app.width * 0.85 222 width: app.width * 0.85
334 223
335 x: app.width * 0.075 224 x: app.width * 0.075
336 y: 50 225 y: app.height * 0.075
337 } 226 }
338 //END AccountWizard 227 //END AccountWizard
339} 228}
diff --git a/components/package/contents/ui/AccountSwitcher.qml b/components/package/contents/ui/AccountSwitcher.qml
index 16e84931..6d1c0aa2 100644
--- a/components/package/contents/ui/AccountSwitcher.qml
+++ b/components/package/contents/ui/AccountSwitcher.qml
@@ -38,9 +38,6 @@ Controls2.Button {
38 id: folderController 38 id: folderController
39 } 39 }
40 40
41 Layout.fillWidth: true
42 height: parent.height
43
44 text: "Accounts" 41 text: "Accounts"
45 42
46 onClicked: { 43 onClicked: {
@@ -54,8 +51,8 @@ Controls2.Button {
54 height: 300 51 height: 300
55 width: 600 52 width: 600
56 53
57 x: parent.x 54 x: 0
58 y: parent.y + parent.height 55 y: - popup.height
59 56
60 modal: true 57 modal: true
61 focus: true 58 focus: true
diff --git a/components/package/contents/ui/MailListView.qml b/components/package/contents/ui/MailListView.qml
index cb0bd4bf..68db1c43 100644
--- a/components/package/contents/ui/MailListView.qml
+++ b/components/package/contents/ui/MailListView.qml
@@ -18,6 +18,7 @@
18 18
19import QtQuick 2.7 19import QtQuick 2.7
20import QtQuick.Controls 2.0 20import QtQuick.Controls 2.0
21import QtQuick.Controls 1.4 as Controls
21import QtQuick.Layouts 1.1 22import QtQuick.Layouts 1.1
22import QtQml 2.2 as QtQml 23import QtQml 2.2 as QtQml
23 24
@@ -36,12 +37,68 @@ Item {
36 currentMail = null 37 currentMail = null
37 } 38 }
38 39
39 ListView { 40 ToolBar {
41 id: toolbar
42
43 width: parent.width
44
45 Row {
46 anchors.centerIn: parent
47
48 spacing: Kirigami.Units.smallSpacing
49
50 Controls.ToolButton {
51 iconName: "mail-mark-unread"
52 text: qsTr("Mark As Read")
53 enabled: mailController.markAsReadAction.enabled
54 tooltip: qsTr("mark mail as read")
55 onClicked: {
56 mailController.markAsReadAction.execute()
57 }
58 }
59
60 Controls.ToolButton {
61 iconName: "mail-mark-important"
62 text: qsTr("Mark Important")
63 enabled: mailController.markAsImportantAction.enabled
64 tooltip: qsTr("mark mail as important")
65 onClicked: {
66 mailController.markAsImportantAction.execute()
67 }
68 }
69
70 Controls.ToolButton {
71 iconName: "edit-delete"
72 text: qsTr("Delete Mail")
73 enabled: mailController.moveToTrashAction.enabled
74 tooltip: qsTr("delete email")
75 onClicked: {
76 mailController.moveToTrashAction.execute()
77 }
78 }
79
80 Controls.ToolButton {
81 iconName: "edit-undo"
82 text: qsTr("Restore Mail")
83 enabled: mailController.restoreFromTrashAction.enabled
84 tooltip: qsTr("restore email")
85 onClicked: {
86 mailController.restoreFromTrashAction.execute()
87 }
88 }
89 }
90 }
91
92 ListView {
40 id: listView 93 id: listView
41 94
42 anchors.fill: parent 95 anchors.top: toolbar.bottom
96
97 width: parent.width
98 height: parent.height - toolbar.height
43 99
44 focus: true 100 focus: true
101 clip: true
45 102
46 ScrollBar.vertical: ScrollBar{ 103 ScrollBar.vertical: ScrollBar{
47 id: scrollbar 104 id: scrollbar