diff --git a/interface/resources/qml/LoginDialog.qml b/interface/resources/qml/LoginDialog.qml index 33e43fdf78..c9cf281b64 100644 --- a/interface/resources/qml/LoginDialog.qml +++ b/interface/resources/qml/LoginDialog.qml @@ -54,7 +54,7 @@ FocusScope { Image { z: -10 id: loginDialogBackground - source: "LoginDialog/background.jpg" + source: "LoginDialog/images/background.jpg" anchors.fill: parent } @@ -63,7 +63,7 @@ FocusScope { id: opaqueRect height: parent.height width: parent.width - opacity: 0.5 + opacity: 0.25 color: "black" } diff --git a/interface/resources/qml/LoginDialog/CompleteProfileBody.qml b/interface/resources/qml/LoginDialog/CompleteProfileBody.qml index ab81515226..cab7c79942 100644 --- a/interface/resources/qml/LoginDialog/CompleteProfileBody.qml +++ b/interface/resources/qml/LoginDialog/CompleteProfileBody.qml @@ -61,23 +61,39 @@ Item { id: contentItem anchors.fill: parent - TextMetrics { - id: loginErrorMessageTextMetrics - font: loginErrorMessage.font - text: loginErrorMessage.text - } - Text { - id: loginErrorMessage - anchors.top: parent.top; - // above buttons. - anchors.topMargin: (parent.height - additionalTextContainer.height) / 2 - hifi.dimensions.contentSpacing.y - profileButton.height - anchors.left: parent.left; - anchors.leftMargin: (parent.width - loginErrorMessageTextMetrics.width) / 2; - color: "red"; - font.family: completeProfileBody.fontFamily - font.pixelSize: completeProfileBody.fontSize - text: completeProfileBody.errorString - visible: true + Item { + id: errorContainer + width: parent.width + height: loginErrorMessageTextMetrics.height + anchors { + bottom: buttons.top; + bottomMargin: hifi.dimensions.contentSpacing.y; + left: buttons.left; + } + TextMetrics { + id: loginErrorMessageTextMetrics + font: loginErrorMessage.font + text: loginErrorMessage.text + } + Text { + id: loginErrorMessage; + width: root.bannerWidth + color: "red"; + font.family: signUpBody.fontFamily + font.pixelSize: 18 + verticalAlignment: Text.AlignVCenter + horizontalAlignment: Text.AlignHCenter + text: completeProfileBody.errorString + visible: true + } + Component.onCompleted: { + if (loginErrorMessageTextMetrics.width > 350 && root.isTablet) { + loginErrorMessage.wrapMode = Text.WordWrap; + loginErrorMessage.verticalAlignment = Text.AlignLeft; + loginErrorMessage.horizontalAlignment = Text.AlignLeft; + errorContainer.height = 2 * loginErrorMessageTextMetrics.height; + } + } } Item { diff --git a/interface/resources/qml/LoginDialog/LinkAccountBody.qml b/interface/resources/qml/LoginDialog/LinkAccountBody.qml index beebfde74a..e7b900fec9 100644 --- a/interface/resources/qml/LoginDialog/LinkAccountBody.qml +++ b/interface/resources/qml/LoginDialog/LinkAccountBody.qml @@ -165,7 +165,9 @@ Item { } onFocusChanged: { root.text = ""; - root.isPassword = !focus; + if (focus) { + root.isPassword = false; + } } } HifiControlsUit.TextField { @@ -471,7 +473,7 @@ Item { onFocusEnabled: { Qt.callLater(function() { emailField.forceActiveFocus(); - }) + }); } } @@ -482,6 +484,9 @@ Item { root.text = ""; d.resize(); init(); + Qt.callLater(function() { + emailField.forceActiveFocus(); + }); } Keys.onPressed: { diff --git a/interface/resources/qml/LoginDialog/LoggingInBody.qml b/interface/resources/qml/LoginDialog/LoggingInBody.qml index 32b9ec431c..71a06a3141 100644 --- a/interface/resources/qml/LoginDialog/LoggingInBody.qml +++ b/interface/resources/qml/LoginDialog/LoggingInBody.qml @@ -72,10 +72,9 @@ Item { loggingInGlyph.visible = true; loggingInText.text = "Logging in to Steam"; loggingInText.x = loggingInHeader.width/2 - loggingInTextMetrics.width/2 + loggingInGlyphTextMetrics.width/2; - } else if (loggingInBody.withOculus) { - loggingInGlyph.visible = true; loggingInGlyph.text = hifi.glyphs.oculus; + loggingInGlyph.visible = true; loggingInText.text = "Logging in to Oculus"; loggingInText.x = loggingInHeader.width/2 - loggingInTextMetrics.width/2 + loggingInGlyphTextMetrics.width/2; } else { @@ -95,16 +94,12 @@ Item { if (loggingInBody.withSteam) { // reset the flag. loggingInGlyph.visible = false; - loggingInText.text = "You are now logged into Steam!" - loggingInText.anchors.centerIn = loggingInHeader; - loggingInText.anchors.bottom = loggingInHeader.bottom; + loggingInText.text = "You are now logged into Steam!"; loggedInGlyph.visible = true; } else if (loggingInBody.withOculus) { // reset the flag. loggingInGlyph.visible = false; - loggingInText.text = "You are now logged into Oculus!" - loggingInText.anchors.centerIn = loggingInHeader; - loggingInText.anchors.bottom = loggingInHeader.bottom; + loggingInText.text = "You are now logged into Oculus!"; loggedInGlyph.text = hifi.glyphs.oculus; loggedInGlyph.visible = true; } else { @@ -119,30 +114,6 @@ Item { height: root.height onHeightChanged: d.resize(); onWidthChanged: d.resize(); - Rectangle { - id: opaqueRect - height: parent.height - width: parent.width - opacity: 0.7 - color: "black" - } - - Item { - id: bannerContainer - width: parent.width - height: banner.height - anchors { - top: parent.top - topMargin: 0.18 * parent.height - } - Image { - id: banner - anchors.centerIn: parent - source: "../../images/high-fidelity-banner.svg" - horizontalAlignment: Image.AlignHCenter - } - } - Item { id: loggingInContainer width: parent.width @@ -176,7 +147,7 @@ Item { // Alignment horizontalAlignment: Text.AlignHCenter; verticalAlignment: Text.AlignVCenter; - visible: loggingInBody.withSteam; + visible: loggingInBody.withSteam || loggingInBody.withOculus; } TextMetrics { @@ -210,7 +181,7 @@ Item { } AnimatedImage { id: loggingInSpinner - source: "../../icons/loader-snake-64-w.gif" + source: "images/loader-snake-298-b.gif" width: 128 height: width anchors.left: parent.left; @@ -254,7 +225,7 @@ Item { onHandleLinkCompleted: { console.log("Link Succeeded"); loggingInBody.linkSteam = false; - loadingSuccess(); + loggingInBody.loadingSuccess(); } onHandleLinkFailed: { console.log("Link Failed: " + error); @@ -263,7 +234,7 @@ Item { onHandleLoginCompleted: { console.log("Login Succeeded"); - loadingSuccess(); + loggingInBody.loadingSuccess(); } onHandleLoginFailed: { diff --git a/interface/resources/qml/LoginDialog/SignUpBody.qml b/interface/resources/qml/LoginDialog/SignUpBody.qml index 0bff4110db..162ac6d344 100644 --- a/interface/resources/qml/LoginDialog/SignUpBody.qml +++ b/interface/resources/qml/LoginDialog/SignUpBody.qml @@ -85,30 +85,6 @@ Item { height: root.height onHeightChanged: d.resize(); onWidthChanged: d.resize(); - Rectangle { - id: opaqueRect - height: parent.height - width: parent.width - opacity: 0.9 - color: "black" - } - - - Item { - id: bannerContainer - width: parent.width - height: banner.height - anchors { - bottom: loginContainer.top - bottomMargin: 0.07 * parent.height - } - Image { - id: banner - anchors.centerIn: parent - source: "../../images/high-fidelity-banner.svg" - horizontalAlignment: Image.AlignHCenter - } - } Item { id: loginContainer width: usernameField.width @@ -189,7 +165,9 @@ Item { } onFocusChanged: { root.text = ""; - root.isPassword = !focus; + if (focus) { + root.isPassword = false; + } } } @@ -232,7 +210,9 @@ Item { } onFocusChanged: { root.text = ""; - root.isPassword = !focus; + if (focus) { + root.isPassword = false; + } } } HifiControlsUit.TextField { @@ -346,13 +326,12 @@ Item { } HifiControlsUit.Button { id: cancelButton - width: emailField.width / 2 + width: (emailField.width - hifi.dimensions.contentSpacing.x) / 2 height: d.minHeightButton anchors { top: keepMeLoggedInCheckbox.bottom topMargin: hifi.dimensions.contentSpacing.y left: parent.left - leftMargin: (parent.width - passwordField.width) / 2 } color: hifi.buttons.noneBorderlessWhite text: qsTr("CANCEL") @@ -365,7 +344,7 @@ Item { } HifiControlsUit.Button { id: signUpButton - width: emailField.width / 2 + width: (emailField.width - hifi.dimensions.contentSpacing.x) / 2 height: d.minHeightButton color: hifi.buttons.blue text: qsTr("Sign Up") diff --git a/interface/resources/qml/LoginDialog/background.jpg b/interface/resources/qml/LoginDialog/background.jpg deleted file mode 100644 index 6cf6c47b47..0000000000 Binary files a/interface/resources/qml/LoginDialog/background.jpg and /dev/null differ diff --git a/interface/resources/qml/LoginDialog/images/background.jpg b/interface/resources/qml/LoginDialog/images/background.jpg new file mode 100644 index 0000000000..db2798a4a1 Binary files /dev/null and b/interface/resources/qml/LoginDialog/images/background.jpg differ diff --git a/interface/resources/qml/LoginDialog/background_tablet.jpg b/interface/resources/qml/LoginDialog/images/background_tablet.jpg similarity index 100% rename from interface/resources/qml/LoginDialog/background_tablet.jpg rename to interface/resources/qml/LoginDialog/images/background_tablet.jpg diff --git a/interface/resources/qml/LoginDialog/images/loader-snake-128.gif b/interface/resources/qml/LoginDialog/images/loader-snake-128.gif deleted file mode 100644 index 8b9e17053b..0000000000 Binary files a/interface/resources/qml/LoginDialog/images/loader-snake-128.gif and /dev/null differ diff --git a/interface/resources/qml/LoginDialog/images/loader-snake-298-b.gif b/interface/resources/qml/LoginDialog/images/loader-snake-298-b.gif new file mode 100644 index 0000000000..d6a475fd1c Binary files /dev/null and b/interface/resources/qml/LoginDialog/images/loader-snake-298-b.gif differ diff --git a/interface/resources/qml/LoginDialog/images/loader-snake-64-w.gif b/interface/resources/qml/LoginDialog/images/loader-snake-64-w.gif deleted file mode 100644 index e6594ab0a2..0000000000 Binary files a/interface/resources/qml/LoginDialog/images/loader-snake-64-w.gif and /dev/null differ diff --git a/interface/resources/qml/OverlayLoginDialog.qml b/interface/resources/qml/OverlayLoginDialog.qml index 76f0cfa8de..6c2eb28ba0 100644 --- a/interface/resources/qml/OverlayLoginDialog.qml +++ b/interface/resources/qml/OverlayLoginDialog.qml @@ -55,7 +55,7 @@ FocusScope { Image { z: -10 id: loginDialogBackground - source: "LoginDialog/background.jpg" + source: "LoginDialog/images/background.jpg" anchors.fill: parent } @@ -64,7 +64,7 @@ FocusScope { id: opaqueRect height: parent.height width: parent.width - opacity: 0.5 + opacity: 0.25 color: "black" } diff --git a/interface/resources/qml/dialogs/TabletLoginDialog.qml b/interface/resources/qml/dialogs/TabletLoginDialog.qml index c1d7a07ba1..5868bf4cad 100644 --- a/interface/resources/qml/dialogs/TabletLoginDialog.qml +++ b/interface/resources/qml/dialogs/TabletLoginDialog.qml @@ -94,7 +94,7 @@ FocusScope { Image { z: -10 id: loginDialogBackground - source: "../LoginDialog/background_tablet.jpg" + source: "../LoginDialog/images/background_tablet.jpg" anchors.fill: parent } @@ -120,7 +120,7 @@ FocusScope { id: opaqueRect height: parent.height width: parent.width - opacity: 0.5 + opacity: 0.25 color: "black" } diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index bdec22c0f3..d58338c908 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -3789,7 +3789,7 @@ bool Application::event(QEvent* event) { } // Allow focused Entities and Overlays to handle keyboard input - if (isKeyEvent(event->type()) && handleKeyEventForFocusedEntityOrOverlay(event)) { + if (isKeyEvent(event->type()) && handleKeyEventForFocusedEntityOrOverlay(event) && !qApp->getLoginDialogPoppedUp()) { return true; } @@ -3902,6 +3902,10 @@ bool Application::eventFilter(QObject* object, QEvent* event) { static bool _altPressed{ false }; void Application::keyPressEvent(QKeyEvent* event) { + if (isHMDMode() && qApp->getLoginDialogPoppedUp()) { + return; + } + _altPressed = event->key() == Qt::Key_Alt; if (!event->isAutoRepeat()) { @@ -4145,6 +4149,10 @@ void Application::keyPressEvent(QKeyEvent* event) { } void Application::keyReleaseEvent(QKeyEvent* event) { + if (isHMDMode() && qApp->getLoginDialogPoppedUp()) { + return; + } + if (!event->isAutoRepeat()) { _keysPressed.remove(event->key()); }