diff --git a/interface/resources/qml/LoginDialog/CompleteProfileBody.qml b/interface/resources/qml/LoginDialog/CompleteProfileBody.qml index d8eeefb608..2a9f44c5e3 100644 --- a/interface/resources/qml/LoginDialog/CompleteProfileBody.qml +++ b/interface/resources/qml/LoginDialog/CompleteProfileBody.qml @@ -42,8 +42,8 @@ Item { maxWidth = root.width; maxHeight = root.height; if (root.isTablet === false) { - var targetWidth = Math.max(Math.max(titleWidth, Math.max(additionalTextContainer.contentWidth, - termsContainer.contentWidth)), mainContainer.width) + var targetWidth = Math.max(Math.max(titleWidth, Math.max(additionalTextContainer.width, + termsContainer.width)), mainContainer.width) parent.width = root.width = Math.max(d.minWidth, Math.min(d.maxWidth, targetWidth)) } var targetHeight = Math.max(5 * hifi.dimensions.contentSpacing.y + d.minHeightButton + additionalTextContainer.height + termsContainer.height, d.maxHeight) @@ -88,7 +88,7 @@ Item { visible: true } Component.onCompleted: { - if (loginErrorMessageTextMetrics.width > 350 && root.isTablet) { + if (loginErrorMessageTextMetrics.width > root.bannerWidth && root.isTablet) { loginErrorMessage.wrapMode = Text.WordWrap; loginErrorMessage.verticalAlignment = Text.AlignLeft; loginErrorMessage.horizontalAlignment = Text.AlignLeft; @@ -148,64 +148,102 @@ Item { } } - HifiStylesUit.ShortcutText { + Item { id: additionalTextContainer + width: parent.width + height: additionalTextMetrics.height anchors { top: buttons.bottom horizontalCenter: parent.horizontalCenter - margins: 0 topMargin: hifi.dimensions.contentSpacing.y + left: parent.left } - text: "Already have a High Fidelity profile? Link to an existing profile here." + TextMetrics { + id: additionalTextMetrics + font: additionalText.font + text: "Already have a High Fidelity profile? Link to an existing profile here." + } - font.family: completeProfileBody.fontFamily - font.pixelSize: completeProfileBody.fontSize - font.bold: completeProfileBody.fontBold - wrapMode: Text.WordWrap - lineHeight: 2 - lineHeightMode: Text.ProportionalHeight - horizontalAlignment: Text.AlignHCenter - linkColor: hifi.colors.blueAccent + HifiStylesUit.ShortcutText { + id: additionalText + text: "Already have a High Fidelity profile? Link to an existing profile here." - onLinkActivated: { - loginDialog.isLogIn = true; - bodyLoader.setSource("LinkAccountBody.qml", { "loginDialog": loginDialog, "root": root, "bodyLoader": bodyLoader, "errorString": "", "withSteam": true, "linkSteam": true }); + font.family: completeProfileBody.fontFamily + font.pixelSize: completeProfileBody.fontSize + font.bold: completeProfileBody.fontBold + wrapMode: Text.NoWrap + lineHeight: 1 + lineHeightMode: Text.ProportionalHeight + horizontalAlignment: Text.AlignHCenter + linkColor: hifi.colors.blueAccent + + onLinkActivated: { + loginDialog.isLogIn = true; + bodyLoader.setSource("LinkAccountBody.qml", { "loginDialog": loginDialog, "root": root, "bodyLoader": bodyLoader, "errorString": "", "withSteam": true, "linkSteam": true }); + } + Component.onCompleted: { + if (additionalTextMetrics.width > root.bannerWidth && root.isTablet) { + additionalText.width = root.bannerWidth; + additionalText.wrapMode = Text.WordWrap; + additionalText.verticalAlignment = Text.AlignLeft; + additionalText.horizontalAlignment = Text.AlignLeft; + additionalTextContainer.height = 3 * additionalTextMetrics.height; + additionalTextContainer.anchors.left = buttons.left; + } else { + additionalText.anchors.centerIn = additionalTextContainer; + } + } } } - TextMetrics { - id: termsContainerTextMetrics - font: termsContainer.font - text: completeProfileBody.termsContainerText - Component.onCompleted: { - // with the link. - termsContainer.text = qsTr("By creating this user profile, you agree to High Fidelity's Terms of Service") - } - } - - HifiStylesUit.InfoItem { + Item { id: termsContainer + width: parent.width + height: termsTextMetrics.height anchors { top: additionalTextContainer.bottom - margins: 0 - topMargin: 2 * hifi.dimensions.contentSpacing.y horizontalCenter: parent.horizontalCenter + topMargin: 2 * hifi.dimensions.contentSpacing.y left: parent.left - leftMargin: (parent.width - termsContainerTextMetrics.width) / 2 + } + TextMetrics { + id: termsTextMetrics + font: termsText.font + text: completeProfileBody.termsContainerText + Component.onCompleted: { + // with the link. + termsText.text = qsTr("By creating this user profile, you agree to High Fidelity's Terms of Service") + } } - text: completeProfileBody.termsContainerText - font.family: completeProfileBody.fontFamily - font.pixelSize: completeProfileBody.fontSize - font.bold: completeProfileBody.fontBold - wrapMode: Text.WordWrap - color: hifi.colors.lightGray - linkColor: hifi.colors.blueAccent - lineHeight: 1 - lineHeightMode: Text.ProportionalHeight + HifiStylesUit.InfoItem { + id: termsText + text: completeProfileBody.termsContainerText + font.family: completeProfileBody.fontFamily + font.pixelSize: completeProfileBody.fontSize + font.bold: completeProfileBody.fontBold + wrapMode: Text.WordWrap + color: hifi.colors.lightGray + linkColor: hifi.colors.blueAccent + lineHeight: 1 + lineHeightMode: Text.ProportionalHeight - onLinkActivated: loginDialog.openUrl(link); + onLinkActivated: loginDialog.openUrl(link); + + Component.onCompleted: { + if (termsTextMetrics.width > root.bannerWidth && root.isTablet) { + termsText.width = root.bannerWidth; + termsText.wrapMode = Text.WordWrap; + additionalText.verticalAlignment = Text.AlignLeft; + additionalText.horizontalAlignment = Text.AlignLeft; + termsContainer.height = 3 * termsTextMetrics.height; + termsContainer.anchors.left = buttons.left; + } else { + termsText.anchors.centerIn = termsContainer; + } + } + } } } } diff --git a/interface/resources/qml/LoginDialog/LinkAccountBody.qml b/interface/resources/qml/LoginDialog/LinkAccountBody.qml index 6fd14bd0f4..e015a071b4 100644 --- a/interface/resources/qml/LoginDialog/LinkAccountBody.qml +++ b/interface/resources/qml/LoginDialog/LinkAccountBody.qml @@ -108,7 +108,7 @@ Item { id: loginContainer width: emailField.width height: errorContainer.height + emailField.height + passwordField.height + 5.5 * hifi.dimensions.contentSpacing.y + - keepMeLoggedInCheckbox.height + loginButton.height + cantAccessTextMetrics.height + continueButton.height + keepMeLoggedInCheckbox.height + loginButton.height + cantAccessTextMetrics.height + continueButton.height + steamInfoTextMetrics.height anchors { top: parent.top topMargin: root.bannerHeight + 0.25 * parent.height @@ -268,10 +268,10 @@ Item { } onCheckedChanged: { Settings.setValue("keepMeLoggedIn", checked); - } - Component.onDestruction: { if (keepMeLoggedInCheckbox.checked) { Settings.setValue("keepMeLoggedIn/savedUsername", emailField.text); + } else { + Settings.setValue("keepMeLoggedIn/savedUsername", ""); } } } @@ -309,8 +309,14 @@ Item { linkAccountBody.login() } } + TextMetrics { + id: steamInfoTextMetrics + font: steamInfoText.font + text: steamInfoText.text + } Text { id: steamInfoText + width: root.bannerWidth visible: linkAccountBody.linkSteam anchors { top: loginButton.bottom @@ -324,6 +330,11 @@ Item { text: qsTr("Your Steam account information will not be exposed to others."); verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignHCenter + Component.onCompleted: { + if (steamInfoTextMetrics.width > root.bannerWidth) { + steamInfoText.wrapMode = Text.WordWrap; + } + } } TextMetrics { id: cantAccessTextMetrics diff --git a/interface/resources/qml/LoginDialog/SignUpBody.qml b/interface/resources/qml/LoginDialog/SignUpBody.qml index 99bc53f6f7..d49d92feeb 100644 --- a/interface/resources/qml/LoginDialog/SignUpBody.qml +++ b/interface/resources/qml/LoginDialog/SignUpBody.qml @@ -313,10 +313,10 @@ Item { } onCheckedChanged: { Settings.setValue("keepMeLoggedIn", checked); - } - Component.onDestruction: { if (keepMeLoggedInCheckbox.checked) { Settings.setValue("keepMeLoggedIn/savedUsername", emailField.text); + } else { + Settings.setValue("keepMeLoggedIn/savedUsername", ""); } } } diff --git a/interface/resources/qml/dialogs/TabletLoginDialog.qml b/interface/resources/qml/dialogs/TabletLoginDialog.qml index 659bf395f9..7bffcbe75c 100644 --- a/interface/resources/qml/dialogs/TabletLoginDialog.qml +++ b/interface/resources/qml/dialogs/TabletLoginDialog.qml @@ -52,8 +52,6 @@ FocusScope { } function tryDestroy() { - canceled(); - root.destroy(); } MouseArea {