changing location of shortcuts

This commit is contained in:
Wayne Chen 2018-09-06 17:29:16 -07:00
parent a5038850f1
commit e76ebf7a0b
2 changed files with 66 additions and 61 deletions

View file

@ -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();

View file

@ -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: "<a href='https://highfidelity.com/users/password/new'>Forgot Username?</a>"
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: "<a href='https://highfidelity.com/users/password/new'>Forgot Username?</a>"
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: "<a href='https://highfidelity.com/users/password/new'>Forgot Password?</a>"
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: "<a href='https://highfidelity.com/users/password/new'>Forgot Password?</a>"
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 {