diff options
Diffstat (limited to 'components')
-rw-r--r-- | components/kube/contents/ui/ComposerView.qml | 126 |
1 files changed, 84 insertions, 42 deletions
diff --git a/components/kube/contents/ui/ComposerView.qml b/components/kube/contents/ui/ComposerView.qml index 01bc3169..b888767d 100644 --- a/components/kube/contents/ui/ComposerView.qml +++ b/components/kube/contents/ui/ComposerView.qml | |||
@@ -61,22 +61,26 @@ Kube.View { | |||
61 | 61 | ||
62 | //Drafts | 62 | //Drafts |
63 | Rectangle { | 63 | Rectangle { |
64 | width: Kube.Units.gridUnit * 20 | 64 | |
65 | Layout.minimumWidth: Kube.Units.gridUnit * 5 | ||
66 | anchors { | 65 | anchors { |
67 | top: parent.top | 66 | top: parent.top |
68 | bottom: parent.bottom | 67 | bottom: parent.bottom |
69 | } | 68 | } |
70 | 69 | ||
70 | width: Kube.Units.gridUnit * 15 | ||
71 | Layout.minimumWidth: Kube.Units.gridUnit * 5 | ||
72 | |||
71 | color: Kube.Colors.textColor | 73 | color: Kube.Colors.textColor |
72 | focus: true | 74 | focus: true |
73 | 75 | ||
74 | ColumnLayout { | 76 | ColumnLayout { |
77 | |||
75 | anchors { | 78 | anchors { |
76 | fill: parent | 79 | fill: parent |
77 | margins: Kube.Units.largeSpacing | 80 | margins: Kube.Units.largeSpacing |
78 | } | 81 | } |
79 | spacing: Kube.Units.smallSpacing | 82 | |
83 | spacing: Kube.Units.largeSpacing | ||
80 | 84 | ||
81 | Kube.PositiveButton { | 85 | Kube.PositiveButton { |
82 | anchors { | 86 | anchors { |
@@ -85,37 +89,35 @@ Kube.View { | |||
85 | margins: Kube.Units.largeSpacing | 89 | margins: Kube.Units.largeSpacing |
86 | } | 90 | } |
87 | focus: true | 91 | focus: true |
88 | text: qsTr("New Mail") | 92 | text: qsTr("New Email") |
89 | onClicked: { | 93 | onClicked: { |
90 | composerController.clear() | 94 | composerController.clear() |
91 | subject.forceActiveFocus() | 95 | subject.forceActiveFocus() |
92 | } | 96 | } |
93 | } | 97 | } |
98 | |||
94 | Kube.Label{ | 99 | Kube.Label{ |
95 | text: qsTr("Drafts") | 100 | text: qsTr("Drafts") |
96 | color: Kube.Colors.highlightedTextColor | 101 | color: Kube.Colors.highlightedTextColor |
97 | } | 102 | } |
103 | |||
98 | ListView { | 104 | ListView { |
99 | id: listView | 105 | id: listView |
100 | Layout.fillHeight: true | 106 | |
101 | anchors { | 107 | anchors { |
102 | left: parent.left | 108 | left: parent.left |
103 | right: parent.right | 109 | right: parent.right |
104 | } | 110 | } |
105 | 111 | ||
112 | Layout.fillHeight: true | ||
106 | clip: true | 113 | clip: true |
107 | 114 | ||
108 | // Controls2.ScrollBar.vertical: Controls2.ScrollBar { | ||
109 | // id: scrollbar | ||
110 | // } | ||
111 | |||
112 | //BEGIN keyboard nav | 115 | //BEGIN keyboard nav |
113 | onActiveFocusChanged: { | 116 | onActiveFocusChanged: { |
114 | if (activeFocus && currentIndex < 0) { | 117 | if (activeFocus && currentIndex < 0) { |
115 | currentIndex = 0 | 118 | currentIndex = 0 |
116 | } | 119 | } |
117 | } | 120 | } |
118 | |||
119 | Keys.onDownPressed: { | 121 | Keys.onDownPressed: { |
120 | listView.incrementCurrentIndex() | 122 | listView.incrementCurrentIndex() |
121 | } | 123 | } |
@@ -144,9 +146,8 @@ Kube.View { | |||
144 | 146 | ||
145 | property variant mail : model.domainObject | 147 | property variant mail : model.domainObject |
146 | 148 | ||
147 | // width: scrollbar.visible ? listView.width - scrollbar.width : listView.width | ||
148 | width: listView.width | 149 | width: listView.width |
149 | height: Kube.Units.gridUnit * 4 | 150 | height: Kube.Units.gridUnit * 3 |
150 | 151 | ||
151 | states: [ | 152 | states: [ |
152 | State { | 153 | State { |
@@ -189,22 +190,15 @@ Kube.View { | |||
189 | margins: Kube.Units.smallSpacing | 190 | margins: Kube.Units.smallSpacing |
190 | } | 191 | } |
191 | 192 | ||
192 | Column { | ||
193 | anchors { | ||
194 | verticalCenter: parent.verticalCenter | ||
195 | left: parent.left | ||
196 | leftMargin: Kube.Units.largeSpacing | ||
197 | } | ||
198 | 193 | ||
199 | Kube.Label{ | 194 | Kube.Label{ |
200 | id: subject | 195 | id: subject |
201 | width: content.width - Kube.Units.gridUnit * 3 | 196 | width: content.width - Kube.Units.largeSpacing * 2 |
202 | text: model.subject | 197 | text: model.subject |
203 | color: Kube.Colors.highlightedTextColor | 198 | color: Kube.Colors.highlightedTextColor |
204 | maximumLineCount: 2 | 199 | maximumLineCount: 2 |
205 | wrapMode: Text.WrapAnywhere | 200 | wrapMode: Text.WrapAnywhere |
206 | elide: Text.ElideRight | 201 | elide: Text.ElideRight |
207 | } | ||
208 | } | 202 | } |
209 | 203 | ||
210 | Kube.Label { | 204 | Kube.Label { |
@@ -267,22 +261,36 @@ Kube.View { | |||
267 | 261 | ||
268 | //Recepients | 262 | //Recepients |
269 | Rectangle { | 263 | Rectangle { |
270 | width: Kube.Units.gridUnit * 20 | ||
271 | Layout.minimumWidth: Kube.Units.gridUnit * 5 | ||
272 | anchors { | 264 | anchors { |
273 | top: parent.top | 265 | top: parent.top |
274 | bottom: parent.bottom | 266 | bottom: parent.bottom |
275 | } | 267 | } |
276 | color: Kube.Colors.backgroundColor | 268 | color: Kube.Colors.backgroundColor |
277 | ColumnLayout { | 269 | width: Kube.Units.gridUnit * 15 |
270 | |||
271 | Rectangle { | ||
272 | height: parent.height | ||
273 | width: 1 | ||
274 | color: Kube.Colors.buttonColor | ||
275 | } | ||
276 | |||
277 | //Content | ||
278 | Item { | ||
279 | anchors.right: parent.right | ||
280 | width: parent.width | ||
281 | height: parent.height | ||
282 | |||
283 | ColumnLayout { | ||
278 | anchors { | 284 | anchors { |
279 | fill: parent | 285 | top: parent.top |
286 | bottom: bottomButtons.top | ||
287 | left: parent.left | ||
288 | right: parent.right | ||
280 | margins: Kube.Units.largeSpacing | 289 | margins: Kube.Units.largeSpacing |
281 | } | 290 | } |
282 | width: parent.width | ||
283 | 291 | ||
284 | Kube.Label { | 292 | Kube.Label { |
285 | text: "Sending Email to" | 293 | text: "Sending Email to:" |
286 | } | 294 | } |
287 | Kube.AutocompleteLineEdit { | 295 | Kube.AutocompleteLineEdit { |
288 | id: to | 296 | id: to |
@@ -294,7 +302,7 @@ Kube.View { | |||
294 | } | 302 | } |
295 | 303 | ||
296 | Kube.Label { | 304 | Kube.Label { |
297 | text: "Sending Copy to (CC)" | 305 | text: "Sending Copy to (CC):" |
298 | } | 306 | } |
299 | Kube.AutocompleteLineEdit { | 307 | Kube.AutocompleteLineEdit { |
300 | id: cc | 308 | id: cc |
@@ -306,7 +314,7 @@ Kube.View { | |||
306 | } | 314 | } |
307 | 315 | ||
308 | Kube.Label { | 316 | Kube.Label { |
309 | text: "Sending Secret Copy to (Bcc)" | 317 | text: "Sending Secret Copy to (Bcc):" |
310 | } | 318 | } |
311 | Kube.AutocompleteLineEdit { | 319 | Kube.AutocompleteLineEdit { |
312 | id: bcc | 320 | id: bcc |
@@ -318,34 +326,61 @@ Kube.View { | |||
318 | } | 326 | } |
319 | 327 | ||
320 | Item { | 328 | Item { |
329 | width: parent.width | ||
321 | Layout.fillHeight: true | 330 | Layout.fillHeight: true |
322 | } | 331 | } |
332 | } | ||
323 | 333 | ||
324 | 334 | ||
325 | Item { | 335 | Item { |
326 | Layout.fillHeight: true | 336 | id: bottomButtons |
327 | } | 337 | anchors { |
338 | bottom: fromLabel.top | ||
339 | bottomMargin: Kube.Units.largeSpacing | ||
340 | horizontalCenter: parent.horizontalCenter | ||
341 | } | ||
342 | width: parent.width - Kube.Units.largeSpacing * 2 | ||
343 | height: Kube.Units.gridUnit | ||
328 | 344 | ||
345 | Kube.Button { | ||
346 | id: saveDraftButton | ||
329 | 347 | ||
330 | Kube.Button { | 348 | anchors.right: parent.right |
331 | id: saveDraftButton | ||
332 | 349 | ||
333 | text: "Save as Draft" | 350 | text: "Save as Draft" |
334 | //TODO enabled: saveAsDraftAction.enabled | 351 | //TODO enabled: saveAsDraftAction.enabled |
335 | onClicked: { | 352 | onClicked: { |
336 | saveAsDraftAction.execute() | 353 | saveAsDraftAction.execute() |
354 | } | ||
355 | } | ||
356 | Kube.Button { | ||
357 | anchors.left: parent.left | ||
358 | |||
359 | text: "Discard" | ||
360 | onClicked: Kube.Fabric.postMessage(Kube.Messages.componentDone, {}) | ||
337 | } | 361 | } |
338 | } | ||
339 | Kube.Button { | ||
340 | text: "Discard" | ||
341 | onClicked: Kube.Fabric.postMessage(Kube.Messages.componentDone, {}) | ||
342 | } | 362 | } |
343 | 363 | ||
344 | Kube.Label { | 364 | Kube.Label { |
365 | id: fromLabel | ||
366 | anchors { | ||
367 | bottom: identityCombo.top | ||
368 | bottomMargin: Kube.Units.smallSpacing | ||
369 | left: identityCombo.left | ||
370 | } | ||
345 | text: "You are sending this from:" | 371 | text: "You are sending this from:" |
346 | } | 372 | } |
373 | |||
347 | Kube.ComboBox { | 374 | Kube.ComboBox { |
348 | id: identityCombo | 375 | id: identityCombo |
376 | |||
377 | anchors { | ||
378 | bottom: sendButton.top | ||
379 | bottomMargin: Kube.Units.largeSpacing | ||
380 | horizontalCenter: parent.horizontalCenter | ||
381 | } | ||
382 | width: parent.width - Kube.Units.largeSpacing * 2 | ||
383 | |||
349 | model: composerController.identitySelector.model | 384 | model: composerController.identitySelector.model |
350 | textRole: "displayName" | 385 | textRole: "displayName" |
351 | Layout.fillWidth: true | 386 | Layout.fillWidth: true |
@@ -355,7 +390,14 @@ Kube.View { | |||
355 | } | 390 | } |
356 | 391 | ||
357 | Kube.PositiveButton { | 392 | Kube.PositiveButton { |
358 | width: saveDraftButton.width | 393 | id: sendButton |
394 | |||
395 | anchors { | ||
396 | bottom: parent.bottom | ||
397 | bottomMargin: Kube.Units.largeSpacing | ||
398 | horizontalCenter: parent.horizontalCenter | ||
399 | } | ||
400 | width: parent.width - Kube.Units.largeSpacing * 2 | ||
359 | 401 | ||
360 | text: "Send" | 402 | text: "Send" |
361 | enabled: sendAction.enabled | 403 | enabled: sendAction.enabled |