From 4e62bfa9a9cb9b715769189a292f655262157333 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Thu, 21 Apr 2016 14:00:37 -0700 Subject: QML UI: allow changing input fields with tab/return key This assumes a physical keyboard (e.g., iPad with BT keyboard). Signed-off-by: Dirk Hohndel --- mobile-widgets/qml/CloudCredentials.qml | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'mobile-widgets/qml') diff --git a/mobile-widgets/qml/CloudCredentials.qml b/mobile-widgets/qml/CloudCredentials.qml index d63227619..2bb42a6ed 100644 --- a/mobile-widgets/qml/CloudCredentials.qml +++ b/mobile-widgets/qml/CloudCredentials.qml @@ -23,6 +23,17 @@ Item { id: outerLayout width: loginWindow.width - loginWindow.leftPadding - loginWindow.rightPadding - 2 * Kirigami.Units.gridUnit + function goToNext() { + for (var i = 0; i < children.length; ++i) + if (children[i].focus) { + children[i].nextItemInFocusChain().forceActiveFocus() + break + } + } + + Keys.onReturnPressed: goToNext() + Keys.onTabPressed: goToNext() + onVisibleChanged: { if (visible && manager.accessingCloud < 0) { manager.appendTextToLog("Credential scrn: show kbd was: " + (Qt.inputMethod.isVisible ? "visible" : "invisible")) -- cgit v1.2.3-70-g09d2