diff options
author | Michael Bohlender <michael.bohlender@kdemail.net> | 2017-01-09 16:38:55 +0100 |
---|---|---|
committer | Michael Bohlender <michael.bohlender@kdemail.net> | 2017-01-09 16:38:55 +0100 |
commit | ebe946c66ce8a251ac98583dbebe33a75eab5480 (patch) | |
tree | 01263231d1d9d1df6adf4bc4f3c6acd439e15597 /components/mail/contents/ui | |
parent | ca5cdbd3076b5fdc6890c08a1abf8619203a73e4 (diff) | |
download | kube-ebe946c66ce8a251ac98583dbebe33a75eab5480.tar.gz kube-ebe946c66ce8a251ac98583dbebe33a75eab5480.zip |
remove app toolbar and move toolbuttons into the columns
Diffstat (limited to 'components/mail/contents/ui')
-rw-r--r-- | components/mail/contents/ui/main.qml | 213 |
1 files changed, 51 insertions, 162 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 | } |