From e76ebf7a0b8a4207436c04d7a30aef1d14919b1b Mon Sep 17 00:00:00 2001 From: Wayne Chen Date: Thu, 6 Sep 2018 17:29:16 -0700 Subject: [PATCH] changing location of shortcuts --- .../LoginDialog/+android/LinkAccountBody.qml | 40 ++++----- .../qml/LoginDialog/LinkAccountBody.qml | 87 ++++++++++--------- 2 files changed, 66 insertions(+), 61 deletions(-) diff --git a/interface/resources/qml/LoginDialog/+android/LinkAccountBody.qml b/interface/resources/qml/LoginDialog/+android/LinkAccountBody.qml index bf7807c85d..96b638c911 100644 --- a/interface/resources/qml/LoginDialog/+android/LinkAccountBody.qml +++ b/interface/resources/qml/LoginDialog/+android/LinkAccountBody.qml @@ -117,27 +117,27 @@ Item { } spacing: hifi.dimensions.contentSpacing.y / 2 - TextField { - id: usernameField - anchors { - horizontalCenter: parent.horizontalCenter - } - width: 1080 - placeholderText: qsTr("Username or Email") + TextField { + id: usernameField + anchors { + horizontalCenter: parent.horizontalCenter } + width: 1080 + placeholderText: qsTr("Username or Email") + } - TextField { - id: passwordField - anchors { - horizontalCenter: parent.horizontalCenter - } - width: 1080 - - placeholderText: qsTr("Password") - echoMode: TextInput.Password - - Keys.onReturnPressed: linkAccountBody.login() + TextField { + id: passwordField + anchors { + horizontalCenter: parent.horizontalCenter } + width: 1080 + + placeholderText: qsTr("Password") + echoMode: TextInput.Password + + Keys.onReturnPressed: linkAccountBody.login() + } } InfoItem { @@ -176,7 +176,7 @@ Item { anchors { left: parent.left top: form.bottom - topMargin: hifi.dimensions.contentSpacing.y / 2 + topMargin: hifi.dimensions.contentSpacing.y / 2 } spacing: hifi.dimensions.contentSpacing.x @@ -201,7 +201,7 @@ Item { anchors { right: parent.right top: form.bottom - topMargin: hifi.dimensions.contentSpacing.y / 2 + topMargin: hifi.dimensions.contentSpacing.y / 2 } spacing: hifi.dimensions.contentSpacing.x onHeightChanged: d.resize(); onWidthChanged: d.resize(); diff --git a/interface/resources/qml/LoginDialog/LinkAccountBody.qml b/interface/resources/qml/LoginDialog/LinkAccountBody.qml index 902466270f..2274d88e04 100644 --- a/interface/resources/qml/LoginDialog/LinkAccountBody.qml +++ b/interface/resources/qml/LoginDialog/LinkAccountBody.qml @@ -15,13 +15,14 @@ import QtQuick.Controls.Styles 1.4 as OriginalStyles import "../controls-uit" import "../styles-uit" - Item { id: linkAccountBody clip: true height: root.pane.height width: root.pane.width property bool failAfterSignUp: false + property var locale: Qt.locale() + property string dateTimeString function login() { mainTextContainer.visible = false @@ -124,29 +125,27 @@ Item { placeholderText: "Username or Email" activeFocusOnPress: true + ShortcutText { + z: 10 + y: usernameField.height + anchors { + right: usernameField.right + topMargin: -19 + } + + text: "Forgot Username?" + + verticalAlignment: Text.AlignVCenter + horizontalAlignment: Text.AlignHCenter + linkColor: hifi.colors.blueAccent + + onLinkActivated: loginDialog.openUrl(link) + } + onFocusChanged: { root.text = ""; } } - ShortcutText { - id: forgotUsernameShortcut - z: 10 - anchors { - leftMargin: usernameField.textFieldLabel.contentWidth + 10 - topMargin: -19 - } - - text: "Forgot Username?" - - verticalAlignment: Text.AlignVCenter - horizontalAlignment: Text.AlignRight - linkColor: hifi.colors.blueAccent - - onLinkActivated: loginDialog.openUrl(link) - Component.onCompleted: { - forgotUsernameShortcut.x = root.implicitWidth - forgotUsernameShortcut.width; - } - } TextField { id: passwordField @@ -154,11 +153,30 @@ Item { placeholderText: "Password" activeFocusOnPress: true echoMode: TextInput.Password + onHeightChanged: d.resize(); onWidthChanged: d.resize(); + + ShortcutText { + id: forgotPasswordShortcut + y: passwordField.height + z: 10 + anchors { + right: passwordField.right + } + + text: "Forgot Password?" + + verticalAlignment: Text.AlignVCenter + horizontalAlignment: Text.AlignHCenter + linkColor: hifi.colors.blueAccent + + onLinkActivated: loginDialog.openUrl(link) + } onFocusChanged: { root.text = ""; root.isPassword = true; } + Image { id: showPasswordImage x: parent.width - ((parent.height) * 31 / 23) @@ -190,7 +208,6 @@ Item { showPasswordImage.y = showPassword ? 0 : (passwordField.height - showPasswordImage.height) / 2; showPasswordHitbox.width = showPasswordImage.width; showPasswordHitbox.x = showPasswordImage.x; - } } } @@ -198,26 +215,6 @@ Item { Keys.onReturnPressed: linkAccountBody.login() } - ShortcutText { - id: forgotPasswordShortcut - z: 10 - anchors { - leftMargin: passwordField.textFieldLabel.contentWidth + 10 - topMargin: -19 - } - - text: "Forgot Password?" - - verticalAlignment: Text.AlignVCenter - horizontalAlignment: Text.AlignHCenter - linkColor: hifi.colors.blueAccent - - onLinkActivated: loginDialog.openUrl(link) - Component.onCompleted: { - forgotPasswordShortcut.x = root.implicitWidth - forgotPasswordShortcut.width; - } - } - InfoItem { id: additionalInformation @@ -304,6 +301,14 @@ Item { } usernameField.forceActiveFocus(); + + var data = { + "date": new Date().toLocaleString(), + }; + print(new Date().toLocaleString()); + print(model.sessionId); + + //UserActivityLogger.logAction("login_screen_shown", ) } Connections {