From 1f1ffbceb15dbc9e8a7ff567666a026ef221039e Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Thu, 21 Sep 2017 19:00:31 +0200 Subject: Autofocus textedit --- .../kolabnow/package/contents/ui/KolabnowAccountSettings.qml | 2 +- components/accounts/contents/ui/AccountWizard.qml | 12 ++++++++---- components/accounts/contents/ui/AccountWizardPage.qml | 3 ++- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/accounts/kolabnow/package/contents/ui/KolabnowAccountSettings.qml b/accounts/kolabnow/package/contents/ui/KolabnowAccountSettings.qml index 309fa443..7468669c 100644 --- a/accounts/kolabnow/package/contents/ui/KolabnowAccountSettings.qml +++ b/accounts/kolabnow/package/contents/ui/KolabnowAccountSettings.qml @@ -23,7 +23,6 @@ import org.kube.framework 1.0 as Kube import org.kube.accounts.kolabnow 1.0 as KolabnowAccount Item { - property string accountId property string heading: qsTr("Connect your Kolab Now account") property string subheadline: qsTr("Please fill in your name and email address.") @@ -57,6 +56,7 @@ Item { } Kube.RequiredTextField { id: nameField + focus: true Layout.fillWidth: true placeholderText: qsTr("Your name") text: kolabnowSettings.userName 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