From cd5fc3ea02bea45dc81dd33d555cf9d1265f9d3a Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Fri, 21 Jul 2017 05:48:53 +0200 Subject: Editor focus --- components/kube/contents/ui/ComposerView.qml | 3 +++ framework/qml/TextEditor.qml | 26 ++++++++++++++------------ 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/components/kube/contents/ui/ComposerView.qml b/components/kube/contents/ui/ComposerView.qml index a8730328..35ae5255 100644 --- a/components/kube/contents/ui/ComposerView.qml +++ b/components/kube/contents/ui/ComposerView.qml @@ -241,6 +241,7 @@ Kube.View { Kube.IconButton { id: deleteButton + activeFocusOnTab: true iconName: Kube.Icons.moveToTrash visible: enabled enabled: !!model.mail @@ -276,6 +277,7 @@ Kube.View { Kube.TextField { id: subject Layout.fillWidth: true + activeFocusOnTab: true placeholderText: "Enter Subject..." text: composerController.subject @@ -329,6 +331,7 @@ Kube.View { Kube.TextEditor { Layout.fillWidth: true Layout.fillHeight: true + activeFocusOnTab: true onActiveFocusChanged: closeFirstSplitIfNecessary() text: composerController.body onTextChanged: composerController.body = text; diff --git a/framework/qml/TextEditor.qml b/framework/qml/TextEditor.qml index d80bebb9..97aa56d2 100644 --- a/framework/qml/TextEditor.qml +++ b/framework/qml/TextEditor.qml @@ -22,21 +22,23 @@ import QtQuick.Controls 2.2 import org.kube.framework 1.0 as Kube -Kube.ScrollHelper { - id: scrollHelper +FocusScope { property alias text: edit.text - flickable: root - Flickable { - id: root + Kube.ScrollHelper { anchors.fill: parent - ScrollBar.vertical: ScrollBar {} - - Kube.TextArea { - id: edit + flickable: flickableItem + Flickable { + id: flickableItem anchors.fill: parent - selectByMouse: true - wrapMode: TextEdit.Wrap + ScrollBar.vertical: ScrollBar {} + + Kube.TextArea { + id: edit + anchors.fill: parent + selectByMouse: true + wrapMode: TextEdit.Wrap + } + TextArea.flickable: edit } - TextArea.flickable: edit } } -- cgit v1.2.3