From 1f1ffbceb15dbc9e8a7ff567666a026ef221039e Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Thu, 21 Sep 2017 19:00:31 +0200 Subject: Autofocus textedit --- components/accounts/contents/ui/AccountWizard.qml | 12 ++++++++---- components/accounts/contents/ui/AccountWizardPage.qml | 3 ++- 2 files changed, 10 insertions(+), 5 deletions(-) (limited to 'components/accounts') diff --git a/components/accounts/contents/ui/AccountWizard.qml b/components/accounts/contents/ui/AccountWizard.qml index 56c975e5..394c3d32 100644 --- a/components/accounts/contents/ui/AccountWizard.qml +++ b/components/accounts/contents/ui/AccountWizard.qml @@ -44,12 +44,17 @@ Kube.Popup { stack.push(mainView.createObject(app)) } } + onCurrentItemChanged: { + if (!!currentItem) { + currentItem.forceActiveFocus() + } + } } Component { id: mainView - Item { + FocusScope { Kube.Heading { id: heading text: qsTr("Select your new account type") @@ -67,9 +72,7 @@ Kube.Popup { delegate: Kube.Button { Layout.fillWidth: true text: modelData - onClicked: { - stack.push(wizardPage.createObject(app, {accountType:modelData})) - } + onClicked: stack.push(wizardPage.createObject(app, {accountType:modelData})) } } } @@ -79,6 +82,7 @@ Kube.Popup { Component { id: wizardPage AccountWizardPage { + focus: true requireSetup: root.requireSetup onDone: { root.close() diff --git a/components/accounts/contents/ui/AccountWizardPage.qml b/components/accounts/contents/ui/AccountWizardPage.qml index f7885ce4..74decf1f 100644 --- a/components/accounts/contents/ui/AccountWizardPage.qml +++ b/components/accounts/contents/ui/AccountWizardPage.qml @@ -24,7 +24,7 @@ import QtQuick.Controls 2.0 as Controls2 import org.kube.framework 1.0 as Kube -Item { +FocusScope { id: root property string accountType signal done() @@ -88,6 +88,7 @@ Item { Loader { id: loader anchors.fill: parent + focus: true source: accountFactory.uiPath } } -- cgit v1.2.3