QML UI: show keyboard when entering credential screen

If the user goes to the credentials screen, they likely want to edit
something.  So put the focus on the first entry field and show the
keyboard.

We also need to hide the keyboard when the credential screen becomes
invisble so that the keyboard doesn't stay around when the dive list
is shown.

Suggested-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2016-03-26 21:27:48 -07:00
parent e216f91ebc
commit 7434e4213b

View file

@ -23,6 +23,16 @@ Item {
ColumnLayout {
id: outerLayout
width: subsurfaceTheme.columnWidth - 2 * MobileComponents.Units.gridUnit
onVisibleChanged: {
if (visible) {
Qt.inputMethod.show()
login.forceActiveFocus()
} else {
Qt.inputMethod.hide()
}
}
MobileComponents.Heading {
text: "Cloud credentials"
level: headingLevel