diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-07-23 20:01:57 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-07-23 20:01:57 +0200 |
commit | dc50471a72c9310db3dd9149be1311e9502bdd9f (patch) | |
tree | 5f9103c374fc24280ae515dc56a2c9c903a52379 | |
parent | a3f1e799e269eaecad0b380534764f098b071560 (diff) | |
download | kube-dc50471a72c9310db3dd9149be1311e9502bdd9f.tar.gz kube-dc50471a72c9310db3dd9149be1311e9502bdd9f.zip |
TextEditor escaping
-rw-r--r-- | components/kube/contents/ui/ComposerView.qml | 244 | ||||
-rw-r--r-- | framework/qml/TextEditor.qml | 1 |
2 files changed, 127 insertions, 118 deletions
diff --git a/components/kube/contents/ui/ComposerView.qml b/components/kube/contents/ui/ComposerView.qml index 35ae5255..24a2bf16 100644 --- a/components/kube/contents/ui/ComposerView.qml +++ b/components/kube/contents/ui/ComposerView.qml | |||
@@ -335,160 +335,170 @@ Kube.View { | |||
335 | onActiveFocusChanged: closeFirstSplitIfNecessary() | 335 | onActiveFocusChanged: closeFirstSplitIfNecessary() |
336 | text: composerController.body | 336 | text: composerController.body |
337 | onTextChanged: composerController.body = text; | 337 | onTextChanged: composerController.body = text; |
338 | Keys.onEscapePressed: recipients.forceActiveFocus() | ||
338 | } | 339 | } |
339 | } | 340 | } |
340 | } | 341 | } |
341 | 342 | ||
342 | //Recepients | 343 | //Recepients |
343 | Rectangle { | 344 | FocusScope { |
345 | id: recipients | ||
344 | anchors { | 346 | anchors { |
345 | top: parent.top | 347 | top: parent.top |
346 | bottom: parent.bottom | 348 | bottom: parent.bottom |
347 | } | 349 | } |
348 | color: Kube.Colors.backgroundColor | 350 | activeFocusOnTab: true |
349 | width: Kube.Units.gridUnit * 15 | 351 | width: Kube.Units.gridUnit * 15 |
350 | |||
351 | Rectangle { | 352 | Rectangle { |
352 | height: parent.height | 353 | anchors.fill: parent |
353 | width: 1 | 354 | color: Kube.Colors.backgroundColor |
354 | color: Kube.Colors.buttonColor | ||
355 | } | ||
356 | 355 | ||
357 | //Content | 356 | Rectangle { |
358 | Item { | 357 | height: parent.height |
359 | anchors.right: parent.right | 358 | width: 1 |
360 | width: parent.width | 359 | color: Kube.Colors.buttonColor |
361 | height: parent.height | 360 | } |
362 | 361 | ||
363 | ColumnLayout { | 362 | //Content |
364 | anchors { | 363 | Item { |
365 | top: parent.top | 364 | anchors.right: parent.right |
366 | bottom: bottomButtons.top | 365 | width: parent.width |
367 | left: parent.left | 366 | height: parent.height |
368 | right: parent.right | 367 | |
369 | margins: Kube.Units.largeSpacing | 368 | ColumnLayout { |
370 | } | 369 | anchors { |
370 | top: parent.top | ||
371 | bottom: bottomButtons.top | ||
372 | left: parent.left | ||
373 | right: parent.right | ||
374 | margins: Kube.Units.largeSpacing | ||
375 | } | ||
371 | 376 | ||
372 | Kube.Label { | 377 | Kube.Label { |
373 | text: qsTr("Sending Email to:") | 378 | text: qsTr("Sending Email to:") |
374 | } | 379 | } |
375 | 380 | ||
376 | AddresseeListEditor { | 381 | AddresseeListEditor { |
377 | id: to | 382 | id: to |
378 | Layout.preferredHeight: to.implicitHeight | 383 | Layout.preferredHeight: to.implicitHeight |
379 | Layout.fillWidth: true | 384 | Layout.fillWidth: true |
380 | completer: composerController.recipientCompleter | 385 | focus: true |
381 | model: composerController.toModel | 386 | activeFocusOnTab: true |
382 | onAdded: composerController.addTo(text) | 387 | completer: composerController.recipientCompleter |
383 | onRemoved: composerController.removeTo(text) | 388 | model: composerController.toModel |
384 | } | 389 | onAdded: composerController.addTo(text) |
390 | onRemoved: composerController.removeTo(text) | ||
391 | } | ||
385 | 392 | ||
386 | Kube.Label { | 393 | Kube.Label { |
387 | text: qsTr("Sending Copy to (CC):") | 394 | text: qsTr("Sending Copy to (CC):") |
388 | } | 395 | } |
389 | AddresseeListEditor { | 396 | AddresseeListEditor { |
390 | id: cc | 397 | id: cc |
391 | Layout.preferredHeight: cc.implicitHeight | 398 | Layout.preferredHeight: cc.implicitHeight |
392 | Layout.fillWidth: true | 399 | Layout.fillWidth: true |
393 | completer: composerController.recipientCompleter | 400 | activeFocusOnTab: true |
394 | model: composerController.ccModel | 401 | completer: composerController.recipientCompleter |
395 | onAdded: composerController.addCc(text) | 402 | model: composerController.ccModel |
396 | onRemoved: composerController.removeCc(text) | 403 | onAdded: composerController.addCc(text) |
397 | } | 404 | onRemoved: composerController.removeCc(text) |
405 | } | ||
398 | 406 | ||
399 | Kube.Label { | 407 | Kube.Label { |
400 | text: qsTr("Sending Secret Copy to (Bcc):") | 408 | text: qsTr("Sending Secret Copy to (Bcc):") |
401 | } | 409 | } |
402 | AddresseeListEditor { | 410 | AddresseeListEditor { |
403 | id: bcc | 411 | id: bcc |
404 | Layout.preferredHeight: bcc.implicitHeight | 412 | Layout.preferredHeight: bcc.implicitHeight |
405 | Layout.fillWidth: true | 413 | Layout.fillWidth: true |
406 | completer: composerController.recipientCompleter | 414 | activeFocusOnTab: true |
407 | model: composerController.bccModel | 415 | completer: composerController.recipientCompleter |
408 | onAdded: composerController.addBcc(text) | 416 | model: composerController.bccModel |
409 | onRemoved: composerController.removeBcc(text) | 417 | onAdded: composerController.addBcc(text) |
410 | } | 418 | onRemoved: composerController.removeBcc(text) |
419 | } | ||
411 | 420 | ||
412 | Item { | 421 | Item { |
413 | width: parent.width | 422 | width: parent.width |
414 | Layout.fillHeight: true | 423 | Layout.fillHeight: true |
424 | } | ||
415 | } | 425 | } |
416 | } | ||
417 | 426 | ||
418 | 427 | ||
419 | Item { | 428 | Item { |
420 | id: bottomButtons | 429 | id: bottomButtons |
421 | anchors { | 430 | anchors { |
422 | bottom: fromLabel.top | 431 | bottom: fromLabel.top |
423 | bottomMargin: Kube.Units.largeSpacing | 432 | bottomMargin: Kube.Units.largeSpacing |
424 | horizontalCenter: parent.horizontalCenter | 433 | horizontalCenter: parent.horizontalCenter |
425 | } | 434 | } |
426 | width: parent.width - Kube.Units.largeSpacing * 2 | 435 | width: parent.width - Kube.Units.largeSpacing * 2 |
427 | height: Kube.Units.gridUnit | 436 | height: Kube.Units.gridUnit |
428 | 437 | ||
429 | Kube.Button { | 438 | Kube.Button { |
430 | id: saveDraftButton | 439 | id: saveDraftButton |
431 | 440 | ||
432 | anchors.right: parent.right | 441 | anchors.right: parent.right |
433 | 442 | ||
434 | text: qsTr("Save as Draft") | 443 | text: qsTr("Save as Draft") |
435 | //TODO enabled: saveAsDraftAction.enabled | 444 | //TODO enabled: saveAsDraftAction.enabled |
436 | onClicked: { | 445 | onClicked: { |
437 | saveAsDraftAction.execute() | 446 | saveAsDraftAction.execute() |
447 | } | ||
438 | } | 448 | } |
439 | } | 449 | Kube.Button { |
440 | Kube.Button { | 450 | anchors.left: parent.left |
441 | anchors.left: parent.left | ||
442 | 451 | ||
443 | text: qsTr("Discard") | 452 | text: qsTr("Discard") |
444 | onClicked: Kube.Fabric.postMessage(Kube.Messages.componentDone, {}) | 453 | onClicked: Kube.Fabric.postMessage(Kube.Messages.componentDone, {}) |
454 | } | ||
445 | } | 455 | } |
446 | } | ||
447 | 456 | ||
448 | Kube.Label { | 457 | Kube.Label { |
449 | id: fromLabel | 458 | id: fromLabel |
450 | anchors { | 459 | anchors { |
451 | bottom: identityCombo.top | 460 | bottom: identityCombo.top |
452 | bottomMargin: Kube.Units.smallSpacing | 461 | bottomMargin: Kube.Units.smallSpacing |
453 | left: identityCombo.left | 462 | left: identityCombo.left |
463 | } | ||
464 | text: qsTr("You are sending this from:") | ||
454 | } | 465 | } |
455 | text: qsTr("You are sending this from:") | ||
456 | } | ||
457 | 466 | ||
458 | Kube.ComboBox { | 467 | Kube.ComboBox { |
459 | id: identityCombo | 468 | id: identityCombo |
460 | 469 | ||
461 | anchors { | 470 | anchors { |
462 | bottom: sendButton.top | 471 | bottom: sendButton.top |
463 | bottomMargin: Kube.Units.largeSpacing | 472 | bottomMargin: Kube.Units.largeSpacing |
464 | horizontalCenter: parent.horizontalCenter | 473 | horizontalCenter: parent.horizontalCenter |
465 | } | 474 | } |
466 | width: parent.width - Kube.Units.largeSpacing * 2 | 475 | width: parent.width - Kube.Units.largeSpacing * 2 |
467 | 476 | ||
468 | model: composerController.identitySelector.model | 477 | model: composerController.identitySelector.model |
469 | textRole: "address" | 478 | textRole: "address" |
470 | Layout.fillWidth: true | 479 | Layout.fillWidth: true |
471 | onCurrentIndexChanged: { | 480 | onCurrentIndexChanged: { |
472 | composerController.identitySelector.currentIndex = currentIndex | 481 | composerController.identitySelector.currentIndex = currentIndex |
482 | } | ||
473 | } | 483 | } |
474 | } | ||
475 | 484 | ||
476 | Kube.PositiveButton { | 485 | Kube.PositiveButton { |
477 | id: sendButton | 486 | id: sendButton |
478 | 487 | ||
479 | anchors { | 488 | anchors { |
480 | bottom: parent.bottom | 489 | bottom: parent.bottom |
481 | bottomMargin: Kube.Units.largeSpacing | 490 | bottomMargin: Kube.Units.largeSpacing |
482 | horizontalCenter: parent.horizontalCenter | 491 | horizontalCenter: parent.horizontalCenter |
483 | } | 492 | } |
484 | width: parent.width - Kube.Units.largeSpacing * 2 | 493 | width: parent.width - Kube.Units.largeSpacing * 2 |
485 | 494 | ||
486 | text: qsTr("Send") | 495 | text: qsTr("Send") |
487 | enabled: sendAction.enabled | 496 | enabled: sendAction.enabled |
488 | onClicked: { | 497 | onClicked: { |
489 | sendAction.execute() | 498 | sendAction.execute() |
499 | } | ||
490 | } | 500 | } |
491 | } | 501 | } |
492 | } | 502 | } |
493 | } | 503 | } //FocusScope |
494 | } | 504 | } |
diff --git a/framework/qml/TextEditor.qml b/framework/qml/TextEditor.qml index 6c11ddf9..b3bd34b8 100644 --- a/framework/qml/TextEditor.qml +++ b/framework/qml/TextEditor.qml | |||
@@ -38,7 +38,6 @@ FocusScope { | |||
38 | anchors.fill: parent | 38 | anchors.fill: parent |
39 | selectByMouse: true | 39 | selectByMouse: true |
40 | wrapMode: TextEdit.Wrap | 40 | wrapMode: TextEdit.Wrap |
41 | Keys.onEscapePressed: nextItemInFocusChain().focus = true | ||
42 | } | 41 | } |
43 | TextArea.flickable: edit | 42 | TextArea.flickable: edit |
44 | } | 43 | } |