From fa790f59ec52b36ef4c25905073c3b0069deb08d Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Sun, 23 Jul 2017 20:05:31 +0200 Subject: Keyboard focus handling --- components/kube/contents/ui/AddresseeListEditor.qml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'components') diff --git a/components/kube/contents/ui/AddresseeListEditor.qml b/components/kube/contents/ui/AddresseeListEditor.qml index 1f106dfd..25916315 100644 --- a/components/kube/contents/ui/AddresseeListEditor.qml +++ b/components/kube/contents/ui/AddresseeListEditor.qml @@ -24,7 +24,7 @@ import QtQuick.Layouts 1.1 import org.kube.framework 1.0 as Kube -Item { +FocusScope { id: root property variant completer property alias model: listView.model @@ -78,14 +78,16 @@ Item { } } - Item { + FocusScope { height: Kube.Units.gridUnit * Kube.Units.smallSpacing * 2 width: parent.width + focus: true Kube.TextButton { id: button text: "+ " + qsTr("Add recipient") color: Kube.Colors.highlightColor + focus: true onClicked: { lineEdit.visible = true lineEdit.forceActiveFocus() @@ -107,6 +109,12 @@ Item { root.added(text); clear() visible = false + button.forceActiveFocus() + } + onAborted: { + clear() + visible = false + button.forceActiveFocus() } } } -- cgit v1.2.3