From 94e20d9a13fa35c91c4a3888feb4764eb1b54be7 Mon Sep 17 00:00:00 2001 From: David Rowe Date: Fri, 14 Oct 2016 14:29:14 +1300 Subject: [PATCH] Fix login dialog keyboard --- interface/resources/qml/LoginDialog.qml | 2 ++ .../qml/LoginDialog/LinkAccountBody.qml | 27 +++++-------------- 2 files changed, 9 insertions(+), 20 deletions(-) diff --git a/interface/resources/qml/LoginDialog.qml b/interface/resources/qml/LoginDialog.qml index 1f84024e15..08895ecaa1 100644 --- a/interface/resources/qml/LoginDialog.qml +++ b/interface/resources/qml/LoginDialog.qml @@ -33,6 +33,8 @@ ModalWindow { property string title: "" property int titleWidth: 0 + keyboardOverride: true // Disable ModalWindow's keyboard. + LoginDialog { id: loginDialog diff --git a/interface/resources/qml/LoginDialog/LinkAccountBody.qml b/interface/resources/qml/LoginDialog/LinkAccountBody.qml index debd40a67b..e1d7a639da 100644 --- a/interface/resources/qml/LoginDialog/LinkAccountBody.qml +++ b/interface/resources/qml/LoginDialog/LinkAccountBody.qml @@ -27,6 +27,7 @@ Item { loginDialog.login(usernameField.text, passwordField.text) } + property bool keyboardEnabled: false property bool keyboardRaised: false property bool punctuationMode: false @@ -46,7 +47,7 @@ Item { root.width = Math.max(d.minWidth, Math.min(d.maxWidth, targetWidth)); root.height = Math.max(d.minHeight, Math.min(d.maxHeight, targetHeight)) - + (linkAccountBody.keyboardRaised ? (200 + 2 * hifi.dimensions.contentSpacing.y) : hifi.dimensions.contentSpacing.y); + + (keyboardEnabled && keyboardRaised ? (200 + 2 * hifi.dimensions.contentSpacing.y) : hifi.dimensions.contentSpacing.y); } } @@ -137,28 +138,13 @@ Item { // Override ScrollingWindow's keyboard that would be at very bottom of dialog. Keyboard { - y: parent.keyboardRaised ? parent.height : 0 - height: parent.keyboardRaised ? 200 : 0 - visible: parent.keyboardRaised && !parent.punctuationMode - enabled: parent.keyboardRaised && !parent.punctuationMode + raised: keyboardEnabled && keyboardRaised + numeric: punctuationMode anchors { left: parent.left right: parent.right bottom: buttons.top - bottomMargin: parent.keyboardRaised ? 2 * hifi.dimensions.contentSpacing.y : 0 - } - } - - KeyboardPunctuation { - y: parent.keyboardRaised ? parent.height : 0 - height: parent.keyboardRaised ? 200 : 0 - visible: parent.keyboardRaised && parent.punctuationMode - enabled: parent.keyboardRaised && parent.punctuationMode - anchors { - left: parent.left - right: parent.right - bottom: buttons.top - bottomMargin: parent.keyboardRaised ? 2 * hifi.dimensions.contentSpacing.y : 0 + bottomMargin: keyboardRaised ? 2 * hifi.dimensions.contentSpacing.y : 0 } } @@ -195,9 +181,10 @@ Item { Component.onCompleted: { root.title = qsTr("Sign Into High Fidelity") root.iconText = "<" + keyboardEnabled = HMD.active; d.resize(); - usernameField.forceActiveFocus() + usernameField.forceActiveFocus(); } Connections {