summaryrefslogtreecommitdiffstats
path: root/components
diff options
context:
space:
mode:
authorMichael Bohlender <michael.bohlender@kdemail.net>2017-04-20 14:04:49 +0200
committerMichael Bohlender <michael.bohlender@kdemail.net>2017-04-20 14:04:49 +0200
commit05197a3f386a8ba26be689805402186efdb4e000 (patch)
tree9e61ef28456c5f296f80651f3750a730fb8cb163 /components
parentc537f2a72ffcdd654fa59d22c4a2364fce22a8e5 (diff)
downloadkube-05197a3f386a8ba26be689805402186efdb4e000.tar.gz
kube-05197a3f386a8ba26be689805402186efdb4e000.zip
introduce main sidebar
Diffstat (limited to 'components')
-rw-r--r--components/kube/contents/ui/Kube.qml343
1 files changed, 189 insertions, 154 deletions
diff --git a/components/kube/contents/ui/Kube.qml b/components/kube/contents/ui/Kube.qml
index 73238a25..f96fef17 100644
--- a/components/kube/contents/ui/Kube.qml
+++ b/components/kube/contents/ui/Kube.qml
@@ -121,97 +121,151 @@ Controls2.ApplicationWindow {
121 //END background 121 //END background
122 122
123 //BEGIN Main content 123 //BEGIN Main content
124 SplitView {
125 anchors {
126 top: app.top
127 left: app.left
128 }
129 124
130 height: app.height 125 RowLayout {
131 width: app.width 126
127 anchors.fill: parent
132 128
133 Rectangle { 129 spacing: 0
134 width: Kube.Units.gridUnit * 10
135 Layout.maximumWidth: app.width * 0.25
136 Layout.minimumWidth: Kube.Units.gridUnit * 5
137 130
138 color: Kube.Colors.textColor 131 Rectangle {
132 id: sideBar
139 133
140 Kube.PositiveButton { 134 width: Kube.Units.gridUnit + Kube.Units.largeSpacing
141 id: newMailButton 135 height: app.height
136 color: "#232629"//Kube.Colors.textColor
142 137
138 Column {
143 anchors { 139 anchors {
144 top: parent.top 140 top: parent.top
145 left: parent.left 141 topMargin: Kube.Units.largeSpacing
146 right: parent.right 142 horizontalCenter: parent.horizontalCenter
147 margins: Kube.Units.largeSpacing
148 } 143 }
149 144
150 text: qsTr("New Email") 145 spacing: Kube.Units.largeSpacing - Kube.Units.smallSpacing
151 146
152 onClicked: { 147 ToolButton {
153 composer.open() 148 iconName: Kube.Icons.search_inverted
149 height: Kube.Units.gridUnit * 1.5
150 width: height
151
152 onClicked: {
153 search.open()
154 }
154 } 155 }
155 }
156 156
157 Item { 157 ToolButton {
158 id: accountName 158 height: Kube.Units.gridUnit * 1.5
159 width: height
159 160
160 Kube.FolderController { 161 iconName: Kube.Icons.mail_inverted
161 id: accountNameFolderController 162
162 accountId: accountSwitcher.accountId 163 onClicked: {
164 //TODO
165 }
163 } 166 }
164 167
165 Menu { 168 ToolButton {
166 id: contextMenu 169 height: Kube.Units.gridUnit * 1.5
167 title: "Edit" 170 width: height
168 171
169 MenuItem { 172 iconName: Kube.Icons.user_inverted
170 text: "Synchronize" 173
171 onTriggered: { 174 onClicked: {
172 accountNameFolderController.synchronizeAction.execute() 175 people.open()
173 }
174 } 176 }
175 } 177 }
178 }
179 }
176 180
177 anchors { 181 SplitView {
178 top: newMailButton.bottom 182
179 topMargin: Kube.Units.smallSpacing 183 height: app.height
180 } 184
185 Layout.fillWidth: true
181 186
182 width: parent.width 187 Rectangle {
183 height: Kube.Units.gridUnit * 2 188 width: Kube.Units.gridUnit * 10
189 Layout.maximumWidth: app.width * 0.25
190 Layout.minimumWidth: Kube.Units.gridUnit * 5
191
192 color: Kube.Colors.textColor
193
194 Kube.PositiveButton {
195 id: newMailButton
196
197 anchors {
198 top: parent.top
199 left: parent.left
200 right: parent.right
201 margins: Kube.Units.largeSpacing
202 }
203
204 text: qsTr("New Email")
184 205
185 MouseArea {
186 anchors.fill: parent
187 acceptedButtons: Qt.RightButton
188 onClicked: { 206 onClicked: {
189 contextMenu.popup() 207 composer.open()
190 } 208 }
191 } 209 }
192 210
193 Repeater { 211 Item {
194 model: currentAccountModel 212 id: accountName
195 Row { 213
196 spacing: Kube.Units.smallSpacing 214 Kube.FolderController {
197 anchors { 215 id: accountNameFolderController
198 bottom: parent.bottom 216 accountId: accountSwitcher.accountId
199 left: parent.left 217 }
200 leftMargin: Kube.Units.smallSpacing 218
219 Menu {
220 id: contextMenu
221 title: "Edit"
222
223 MenuItem {
224 text: "Synchronize"
225 onTriggered: {
226 accountNameFolderController.synchronizeAction.execute()
227 }
201 } 228 }
202 Layout.fillHeight: true 229 }
203 230
204 Kube.Label{ 231 anchors {
205 text: model.name 232 top: newMailButton.bottom
206 font.weight: Font.Bold 233 topMargin: Kube.Units.smallSpacing
207 color: Kube.Colors.highlightedTextColor 234 }
235
236 width: parent.width
237 height: Kube.Units.gridUnit * 2
238
239 MouseArea {
240 anchors.fill: parent
241 acceptedButtons: Qt.RightButton
242 onClicked: {
243 contextMenu.popup()
208 } 244 }
245 }
209 246
210 Kube.Icon { 247 Repeater {
211 id: statusIcon 248 model: currentAccountModel
212 visible: false 249 Row {
213 iconName: "" 250 spacing: Kube.Units.smallSpacing
214 states: [ 251 anchors {
252 bottom: parent.bottom
253 left: parent.left
254 leftMargin: Kube.Units.smallSpacing
255 }
256 Layout.fillHeight: true
257
258 Kube.Label{
259 text: model.name
260 font.weight: Font.Bold
261 color: Kube.Colors.highlightedTextColor
262 }
263
264 Kube.Icon {
265 id: statusIcon
266 visible: false
267 iconName: ""
268 states: [
215 State { 269 State {
216 name: "busy"; when: model.status == Kube.AccountsModel.BusyStatus 270 name: "busy"; when: model.status == Kube.AccountsModel.BusyStatus
217 PropertyChanges { target: statusIcon; iconName: Kube.Icons.busy_inverted; visible: true } 271 PropertyChanges { target: statusIcon; iconName: Kube.Icons.busy_inverted; visible: true }
@@ -228,129 +282,110 @@ Controls2.ApplicationWindow {
228 name: "disconnected"; when: model.status == Kube.AccountsModel.OfflineStatus 282 name: "disconnected"; when: model.status == Kube.AccountsModel.OfflineStatus
229 PropertyChanges { target: statusIcon; iconName: Kube.Icons.noNetworkConnection_inverted; visible: true } 283 PropertyChanges { target: statusIcon; iconName: Kube.Icons.noNetworkConnection_inverted; visible: true }
230 } 284 }
231 ] 285 ]
286 }
232 } 287 }
233 } 288 }
234 } 289 }
235 }
236 290
237 Kube.FolderListView { 291 Kube.FolderListView {
238 id: folderListView 292 id: folderListView
239 293
240 anchors { 294 anchors {
241 top: accountName.bottom 295 top: accountName.bottom
242 topMargin: Kube.Units.smallSpacing 296 topMargin: Kube.Units.smallSpacing
243 bottom: statusBar.top 297 bottom: statusBar.top
244 left: parent.left 298 left: parent.left
245 right: parent.right 299 right: parent.right
246 } 300 }
247
248 focus: true
249 accountId: accountSwitcher.accountId
250 }
251 301
252 Item { 302 focus: true
253 id: statusBar 303 accountId: accountSwitcher.accountId
254 anchors {
255 topMargin: Kube.Units.smallSpacing
256 bottom: outbox.top
257 left: parent.left
258 right: parent.right
259 } 304 }
260 305
261 height: Kube.Units.gridUnit 306 Item {
307 id: statusBar
308 anchors {
309 topMargin: Kube.Units.smallSpacing
310 bottom: outbox.top
311 left: parent.left
312 right: parent.right
313 }
262 314
263 Repeater { 315 height: Kube.Units.gridUnit
264 model: currentAccountModel 316
265 Kube.Label { 317 Repeater {
266 id: statusText 318 model: currentAccountModel
267 anchors.centerIn: parent 319 Kube.Label {
268 visible: false 320 id: statusText
269 color: Kube.Colors.highlightedTextColor 321 anchors.centerIn: parent
270 states: [ 322 visible: false
323 color: Kube.Colors.highlightedTextColor
324 states: [
271 State { 325 State {
272 name: "disconnected"; when: model.status == Kube.AccountsModel.OfflineStatus 326 name: "disconnected"; when: model.status == Kube.AccountsModel.OfflineStatus
273 PropertyChanges { target: statusText; text: "Offline"; visible: true } 327 PropertyChanges { target: statusText; text: "Offline"; visible: true }
274 } 328 }
275 ] 329 ]
330 }
276 } 331 }
277 } 332 }
278 }
279
280 Kube.Outbox {
281 id: outbox
282
283 anchors {
284 bottom: toolBar.top
285 left: parent.left
286 right: parent.right
287 }
288 height: Kube.Units.gridUnit * 1.5
289 }
290
291 333
292 Item { 334 Kube.Outbox {
293 id: toolBar 335 id: outbox
294 336
295 anchors { 337 anchors {
296 bottom: parent.bottom 338 bottom: toolBar.top
297 left: parent.left 339 left: parent.left
298 right: parent.right 340 right: parent.right
341 }
342 height: Kube.Units.gridUnit * 1.5
299 } 343 }
300 height: Kube.Units.gridUnit * 2
301 344
302 RowLayout {
303 anchors.centerIn: parent
304 345
305 spacing: Kube.Units.largeSpacing 346 Item {
347 id: toolBar
306 348
307 Kube.AccountSwitcher { 349 anchors {
308 id: accountSwitcher 350 bottom: parent.bottom
309 iconName: Kube.Icons.menu_inverted 351 left: parent.left
310 height: Kube.Units.gridUnit * 1.5 352 right: parent.right
311 width: height
312 } 353 }
354 height: Kube.Units.gridUnit * 2
313 355
314 ToolButton { 356 RowLayout {
315 iconName: Kube.Icons.user_inverted 357 anchors.centerIn: parent
316 height: Kube.Units.gridUnit * 1.5
317 width: height
318
319 onClicked: {
320 people.open()
321 }
322 }
323 358
324 ToolButton { 359 spacing: Kube.Units.largeSpacing
325 iconName: Kube.Icons.search_inverted
326 height: Kube.Units.gridUnit * 1.5
327 width: height
328 360
329 onClicked: { 361 Kube.AccountSwitcher {
330 search.open() 362 id: accountSwitcher
363 iconName: Kube.Icons.menu_inverted
364 height: Kube.Units.gridUnit * 1.5
365 width: height
331 } 366 }
332 } 367 }
333 } 368 }
334 }
335 369
336 } 370 }
337 371
338 Kube.MailListView { 372 Kube.MailListView {
339 id: mailListView 373 id: mailListView
340 parentFolder: folderListView.currentFolder 374 parentFolder: folderListView.currentFolder
341 width: Kube.Units.gridUnit * 20 375 width: Kube.Units.gridUnit * 20
342 height: parent.height 376 height: parent.height
343 Layout.maximumWidth: app.width * 0.4 377 Layout.maximumWidth: app.width * 0.4
344 Layout.minimumWidth: Kube.Units.gridUnit * 10 378 Layout.minimumWidth: Kube.Units.gridUnit * 10
345 focus: true 379 focus: true
346 } 380 }
347 381
348 Kube.ConversationView { 382 Kube.ConversationView {
349 id: mailView 383 id: mailView
350 mail: mailListView.currentMail 384 mail: mailListView.currentMail
351 Layout.fillWidth: true 385 Layout.fillWidth: true
352 hideTrash: !folderListView.isTrashFolder 386 hideTrash: !folderListView.isTrashFolder
353 hideNonTrash: folderListView.isTrashFolder 387 hideNonTrash: folderListView.isTrashFolder
388 }
354 } 389 }
355 } 390 }
356 //END Main content 391 //END Main content