mirror of
https://github.com/Armored-Dragon/overte.git
synced 2025-03-11 16:13:16 +01:00
UI feedback + new overlay position update
This commit is contained in:
parent
d8a1c4e956
commit
527f8a2b59
7 changed files with 109 additions and 161 deletions
|
@ -29,10 +29,12 @@ Item {
|
||||||
QtObject {
|
QtObject {
|
||||||
id: d
|
id: d
|
||||||
readonly property int minWidth: 480
|
readonly property int minWidth: 480
|
||||||
readonly property int minWidthButton: !root.isTablet ? 256 : 174
|
// readonly property int minWidthButton: !root.isTablet ? 256 : 174
|
||||||
|
readonly property int minWidthButton: 36
|
||||||
property int maxWidth: root.isTablet ? 1280 : root.width
|
property int maxWidth: root.isTablet ? 1280 : root.width
|
||||||
readonly property int minHeight: 120
|
readonly property int minHeight: 120
|
||||||
readonly property int minHeightButton: !root.isTablet ? 56 : 42
|
// readonly property int minHeightButton: !root.isTablet ? 56 : 42
|
||||||
|
readonly property int minHeightButton: 36
|
||||||
property int maxHeight: root.isTablet ? 720 : root.height
|
property int maxHeight: root.isTablet ? 720 : root.height
|
||||||
|
|
||||||
function resize() {
|
function resize() {
|
||||||
|
|
|
@ -26,14 +26,14 @@ Item {
|
||||||
property int textFieldHeight: 31
|
property int textFieldHeight: 31
|
||||||
property string fontFamily: "Raleway"
|
property string fontFamily: "Raleway"
|
||||||
property int fontSize: 15
|
property int fontSize: 15
|
||||||
|
// property int textFieldFontSize: !root.isTablet ? !root.isOverlay : hifi.fontSizes.textFieldInput ? hifi.fontSizes.textFieldInput : 18
|
||||||
|
property int textFieldFontSize: 18
|
||||||
property bool fontBold: true
|
property bool fontBold: true
|
||||||
|
|
||||||
property bool keyboardEnabled: false
|
property bool keyboardEnabled: false
|
||||||
property bool keyboardRaised: false
|
property bool keyboardRaised: false
|
||||||
property bool punctuationMode: false
|
property bool punctuationMode: false
|
||||||
|
|
||||||
onKeyboardRaisedChanged: d.resize();
|
|
||||||
|
|
||||||
property bool withSteam: false
|
property bool withSteam: false
|
||||||
property bool withOculus: false
|
property bool withOculus: false
|
||||||
property string errorString: errorString
|
property string errorString: errorString
|
||||||
|
@ -44,23 +44,22 @@ Item {
|
||||||
readonly property int minWidthButton: !root.isTablet ? 256 : 174
|
readonly property int minWidthButton: !root.isTablet ? 256 : 174
|
||||||
property int maxWidth: root.isTablet ? 1280 : root.width
|
property int maxWidth: root.isTablet ? 1280 : root.width
|
||||||
readonly property int minHeight: 120
|
readonly property int minHeight: 120
|
||||||
readonly property int minHeightButton: !root.isTablet ? 56 : 42
|
// readonly property int minHeightButton: !root.isTablet ? 56 : 42
|
||||||
|
readonly property int minHeightButton: 36
|
||||||
property int maxHeight: root.isTablet ? 720 : root.height
|
property int maxHeight: root.isTablet ? 720 : root.height
|
||||||
|
|
||||||
function resize() {
|
function resize() {
|
||||||
maxWidth = root.isTablet ? 1280 : root.width;
|
maxWidth = root.isTablet ? 1280 : root.width;
|
||||||
maxHeight = root.isTablet ? 720 : root.height;
|
maxHeight = root.isTablet ? 720 : root.height;
|
||||||
var targetWidth = Math.max(titleWidth, mainContainer.width);
|
var targetWidth = Math.max(titleWidth, mainContainer.width);
|
||||||
var targetHeight = hifi.dimensions.contentSpacing.y + mainContainer.height +
|
var targetHeight = hifi.dimensions.contentSpacing.y + mainContainer.height + 4 * hifi.dimensions.contentSpacing.y;
|
||||||
4 * hifi.dimensions.contentSpacing.y;
|
|
||||||
|
|
||||||
var newWidth = Math.max(d.minWidth, Math.min(d.maxWidth, targetWidth));
|
var newWidth = Math.max(d.minWidth, Math.min(d.maxWidth, targetWidth));
|
||||||
if (!isNaN(newWidth)) {
|
if (!isNaN(newWidth)) {
|
||||||
parent.width = root.width = newWidth;
|
parent.width = root.width = newWidth;
|
||||||
}
|
}
|
||||||
|
|
||||||
parent.height = root.height = Math.max(d.minHeight, Math.min(d.maxHeight, targetHeight))
|
parent.height = root.height = Math.max(d.minHeight, Math.min(d.maxHeight, targetHeight)) + hifi.dimensions.contentSpacing.y;
|
||||||
+ (keyboardEnabled && keyboardRaised ? (200 + 2 * hifi.dimensions.contentSpacing.y) : hifi.dimensions.contentSpacing.y);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -72,19 +71,13 @@ Item {
|
||||||
function init() {
|
function init() {
|
||||||
// going to/from sign in/up dialog.
|
// going to/from sign in/up dialog.
|
||||||
loginDialog.isLogIn = true;
|
loginDialog.isLogIn = true;
|
||||||
loginErrorMessage.visible = (linkAccountBody.errorString !== "");
|
loginErrorMessage.text = linkAccountBody.errorString;
|
||||||
if (linkAccountBody.errorString !== "") {
|
loginErrorMessage.visible = (linkAccountBody.errorString !== "");
|
||||||
loginErrorMessage.text = linkAccountBody.errorString;
|
|
||||||
errorContainer.anchors.bottom = emailField.top;
|
|
||||||
errorContainer.anchors.left = emailField.left;
|
|
||||||
}
|
|
||||||
loginButton.text = "Log In";
|
loginButton.text = "Log In";
|
||||||
loginButton.color = hifi.buttons.blue;
|
loginButton.color = hifi.buttons.blue;
|
||||||
emailField.placeholderText = "Username or Email";
|
emailField.placeholderText = "Username or Email";
|
||||||
var savedUsername = Settings.getValue("keepMeLoggedIn/savedUsername", "");
|
var savedUsername = Settings.getValue("keepMeLoggedIn/savedUsername", "");
|
||||||
emailField.text = keepMeLoggedInCheckbox.checked ? savedUsername === "Unknown user" ? "" : savedUsername : "";
|
emailField.text = keepMeLoggedInCheckbox.checked ? savedUsername === "Unknown user" ? "" : savedUsername : "";
|
||||||
emailField.anchors.top = loginContainer.top;
|
|
||||||
emailField.anchors.topMargin = !root.isTablet ? 0.2 * root.height : 0.24 * root.height;
|
|
||||||
loginContainer.visible = true;
|
loginContainer.visible = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -108,7 +101,7 @@ Item {
|
||||||
height: banner.height
|
height: banner.height
|
||||||
anchors {
|
anchors {
|
||||||
top: parent.top
|
top: parent.top
|
||||||
topMargin: 85
|
topMargin: 0.03 * parent.height
|
||||||
}
|
}
|
||||||
Image {
|
Image {
|
||||||
id: banner
|
id: banner
|
||||||
|
@ -126,14 +119,13 @@ Item {
|
||||||
top: bannerContainer.bottom
|
top: bannerContainer.bottom
|
||||||
topMargin: 1.5 * hifi.dimensions.contentSpacing.y
|
topMargin: 1.5 * hifi.dimensions.contentSpacing.y
|
||||||
}
|
}
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: errorContainer
|
id: errorContainer
|
||||||
width: loginErrorMessageTextMetrics.width
|
width: loginErrorMessageTextMetrics.width
|
||||||
height: loginErrorMessageTextMetrics.height
|
height: loginErrorMessageTextMetrics.height
|
||||||
anchors {
|
anchors {
|
||||||
bottom: emailField.top;
|
bottom: emailField.top;
|
||||||
bottomMargin: 2;
|
bottomMargin: hifi.dimensions.contentSpacing.y;
|
||||||
left: emailField.left;
|
left: emailField.left;
|
||||||
}
|
}
|
||||||
TextMetrics {
|
TextMetrics {
|
||||||
|
@ -145,7 +137,7 @@ Item {
|
||||||
id: loginErrorMessage;
|
id: loginErrorMessage;
|
||||||
color: "red";
|
color: "red";
|
||||||
font.family: linkAccountBody.fontFamily
|
font.family: linkAccountBody.fontFamily
|
||||||
font.pixelSize: 12
|
font.pixelSize: linkAccountBody.textFieldFontSize
|
||||||
verticalAlignment: Text.AlignVCenter
|
verticalAlignment: Text.AlignVCenter
|
||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
text: ""
|
text: ""
|
||||||
|
@ -157,9 +149,10 @@ Item {
|
||||||
id: emailField
|
id: emailField
|
||||||
width: banner.width
|
width: banner.width
|
||||||
height: linkAccountBody.textFieldHeight
|
height: linkAccountBody.textFieldHeight
|
||||||
font.family: "Fira Sans"
|
font.pixelSize: linkAccountBody.textFieldFontSize
|
||||||
anchors {
|
anchors {
|
||||||
top: parent.top
|
top: parent.top
|
||||||
|
topMargin: 0.2 * root.height
|
||||||
left: parent.left
|
left: parent.left
|
||||||
leftMargin: (parent.width - emailField.width) / 2
|
leftMargin: (parent.width - emailField.width) / 2
|
||||||
}
|
}
|
||||||
|
@ -194,7 +187,7 @@ Item {
|
||||||
id: passwordField
|
id: passwordField
|
||||||
width: banner.width
|
width: banner.width
|
||||||
height: linkAccountBody.textFieldHeight
|
height: linkAccountBody.textFieldHeight
|
||||||
font.family: "Fira Sans"
|
font.pixelSize: linkAccountBody.textFieldFontSize
|
||||||
placeholderText: "Password"
|
placeholderText: "Password"
|
||||||
activeFocusOnPress: true
|
activeFocusOnPress: true
|
||||||
echoMode: passwordFieldMouseArea.showPassword ? TextInput.Normal : TextInput.Password
|
echoMode: passwordFieldMouseArea.showPassword ? TextInput.Normal : TextInput.Password
|
||||||
|
@ -306,30 +299,25 @@ Item {
|
||||||
linkAccountBody.login()
|
linkAccountBody.login()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Item {
|
HifiStylesUit.ShortcutText {
|
||||||
id: cantAccessContainer
|
id: cantAccessText
|
||||||
width: parent.width
|
z: 10
|
||||||
height: emailField.height
|
|
||||||
anchors {
|
anchors {
|
||||||
top: loginButton.bottom
|
top: loginButton.bottom
|
||||||
topMargin: hifi.dimensions.contentSpacing.y
|
topMargin: hifi.dimensions.contentSpacing.y
|
||||||
|
left: emailField.left
|
||||||
}
|
}
|
||||||
HifiStylesUit.ShortcutText {
|
font.family: linkAccountBody.fontFamily
|
||||||
id: cantAccessText
|
font.pixelSize: 18
|
||||||
z: 10
|
|
||||||
anchors.centerIn: parent
|
|
||||||
font.family: linkAccountBody.fontFamily
|
|
||||||
font.pixelSize: 18
|
|
||||||
|
|
||||||
text: "<a href='https://highfidelity.com/users/password/new'> Can't access your account?</a>"
|
text: "<a href='https://highfidelity.com/users/password/new'> Can't access your account?</a>"
|
||||||
|
|
||||||
verticalAlignment: Text.AlignVCenter
|
verticalAlignment: Text.AlignVCenter
|
||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
linkColor: hifi.colors.blueAccent
|
linkColor: hifi.colors.blueAccent
|
||||||
onLinkActivated: {
|
onLinkActivated: {
|
||||||
Tablet.playSound(TabletEnums.ButtonClick);
|
Tablet.playSound(TabletEnums.ButtonClick);
|
||||||
loginDialog.openUrl(link)
|
loginDialog.openUrl(link)
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
HifiControlsUit.Button {
|
HifiControlsUit.Button {
|
||||||
|
@ -357,8 +345,6 @@ Item {
|
||||||
loginDialog.loginThroughSteam();
|
loginDialog.loginThroughSteam();
|
||||||
}
|
}
|
||||||
|
|
||||||
print("withSteam " + linkAccountBody.withSteam);
|
|
||||||
print("withOculus " + linkAccountBody.withOculus);
|
|
||||||
bodyLoader.setSource("LoggingInBody.qml", { "loginDialog": loginDialog, "root": root, "bodyLoader": bodyLoader,
|
bodyLoader.setSource("LoggingInBody.qml", { "loginDialog": loginDialog, "root": root, "bodyLoader": bodyLoader,
|
||||||
"withSteam": linkAccountBody.withSteam, "withOculus": linkAccountBody.withOculus, "fromBody": "LinkAccountBody" });
|
"withSteam": linkAccountBody.withSteam, "withOculus": linkAccountBody.withOculus, "fromBody": "LinkAccountBody" });
|
||||||
}
|
}
|
||||||
|
@ -379,7 +365,6 @@ Item {
|
||||||
id: signUpContainer
|
id: signUpContainer
|
||||||
width: emailField.width
|
width: emailField.width
|
||||||
height: emailField.height
|
height: emailField.height
|
||||||
|
|
||||||
anchors {
|
anchors {
|
||||||
left: emailField.left
|
left: emailField.left
|
||||||
bottom: parent.bottom
|
bottom: parent.bottom
|
||||||
|
@ -425,48 +410,36 @@ Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Item {
|
TextMetrics {
|
||||||
id: dismissTextContainer
|
id: dismissButtonTextMetrics
|
||||||
width: dismissText.width
|
font: loginErrorMessage.font
|
||||||
height: dismissText.height
|
text: dismissButton.text
|
||||||
|
}
|
||||||
|
HifiControlsUit.Button {
|
||||||
|
id: dismissButton
|
||||||
|
width: dismissButtonTextMetrics.width
|
||||||
|
height: d.minHeightButton
|
||||||
anchors {
|
anchors {
|
||||||
bottom: parent.bottom
|
bottom: parent.bottom
|
||||||
right: parent.right
|
right: parent.right
|
||||||
margins: 3 * hifi.dimensions.contentSpacing.y
|
margins: 3 * hifi.dimensions.contentSpacing.y
|
||||||
}
|
}
|
||||||
visible: loginDialog.getLoginDialogPoppedUp()
|
color: hifi.buttons.noneBorderlessWhite
|
||||||
Text {
|
text: qsTr("No thanks, take me in-world! >")
|
||||||
id: dismissText
|
fontCapitalization: Font.MixedCase
|
||||||
text: qsTr("No thanks, take me in-world! >")
|
fontFamily: linkAccountBody.fontFamily
|
||||||
|
fontSize: linkAccountBody.fontSize
|
||||||
lineHeight: 1
|
fontBold: linkAccountBody.fontBold
|
||||||
color: "white"
|
onClicked: {
|
||||||
font.family: linkAccountBody.fontFamily
|
if (loginDialog.getLoginDialogPoppedUp()) {
|
||||||
font.pixelSize: 20
|
console.log("[ENCOURAGELOGINDIALOG]: user dismissed login screen")
|
||||||
font.bold: linkAccountBody.fontBold
|
var data = {
|
||||||
lineHeightMode: Text.ProportionalHeight
|
"action": "user dismissed login screen"
|
||||||
horizontalAlignment: Text.AlignHCenter
|
};
|
||||||
}
|
UserActivityLogger.logAction("encourageLoginDialog", data);
|
||||||
MouseArea {
|
loginDialog.dismissLoginDialog();
|
||||||
id: dismissMouseArea
|
|
||||||
anchors.fill: parent
|
|
||||||
acceptedButtons: Qt.LeftButton
|
|
||||||
hoverEnabled: true
|
|
||||||
onEntered: {
|
|
||||||
Tablet.playSound(TabletEnums.ButtonHover);
|
|
||||||
}
|
|
||||||
onClicked: {
|
|
||||||
Tablet.playSound(TabletEnums.ButtonClick);
|
|
||||||
if (loginDialog.getLoginDialogPoppedUp()) {
|
|
||||||
console.log("[ENCOURAGELOGINDIALOG]: user dismissed login screen")
|
|
||||||
var data = {
|
|
||||||
"action": "user dismissed login screen"
|
|
||||||
};
|
|
||||||
UserActivityLogger.logAction("encourageLoginDialog", data);
|
|
||||||
loginDialog.dismissLoginDialog();
|
|
||||||
}
|
|
||||||
root.tryDestroy();
|
|
||||||
}
|
}
|
||||||
|
root.tryDestroy();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
//
|
//
|
||||||
// SignInBody.qml
|
// signUpBody.qml
|
||||||
//
|
//
|
||||||
// Created by Stephen Birarda on 7 Dec 2016
|
// Created by Stephen Birarda on 7 Dec 2016
|
||||||
// Copyright 2016 High Fidelity, Inc.
|
// Copyright 2016 High Fidelity, Inc.
|
||||||
|
@ -18,13 +18,15 @@ import stylesUit 1.0 as HifiStylesUit
|
||||||
import TabletScriptingInterface 1.0
|
import TabletScriptingInterface 1.0
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: signInBody
|
id: signUpBody
|
||||||
clip: true
|
clip: true
|
||||||
height: root.height
|
height: root.height
|
||||||
width: root.width
|
width: root.width
|
||||||
property int textFieldHeight: 31
|
property int textFieldHeight: 31
|
||||||
property string fontFamily: "Raleway"
|
property string fontFamily: "Raleway"
|
||||||
property int fontSize: 15
|
property int fontSize: 15
|
||||||
|
// property int textFieldFontSize: !root.isTablet ? !root.isOverlay : hifi.fontSizes.textFieldInput ? hifi.fontSizes.textFieldInput : 18
|
||||||
|
property int textFieldFontSize: 18
|
||||||
property bool fontBold: true
|
property bool fontBold: true
|
||||||
|
|
||||||
property bool keyboardEnabled: false
|
property bool keyboardEnabled: false
|
||||||
|
@ -41,7 +43,8 @@ Item {
|
||||||
readonly property int minWidthButton: !root.isTablet ? 256 : 174
|
readonly property int minWidthButton: !root.isTablet ? 256 : 174
|
||||||
property int maxWidth: root.isTablet ? 1280 : root.width
|
property int maxWidth: root.isTablet ? 1280 : root.width
|
||||||
readonly property int minHeight: 120
|
readonly property int minHeight: 120
|
||||||
readonly property int minHeightButton: !root.isTablet ? 56 : 42
|
// readonly property int minHeightButton: !root.isTablet ? 56 : 42
|
||||||
|
readonly property int minHeightButton: 36
|
||||||
property int maxHeight: root.isTablet ? 720 : root.height
|
property int maxHeight: root.isTablet ? 720 : root.height
|
||||||
|
|
||||||
function resize() {
|
function resize() {
|
||||||
|
@ -70,14 +73,13 @@ Item {
|
||||||
function init() {
|
function init() {
|
||||||
// going to/from sign in/up dialog.
|
// going to/from sign in/up dialog.
|
||||||
loginDialog.isLogIn = false;
|
loginDialog.isLogIn = false;
|
||||||
loginErrorMessage.visible = (signInBody.errorString !== "");
|
loginErrorMessage.visible = (signUpBody.errorString !== "");
|
||||||
if (signInBody.errorString !== "") {
|
if (signUpBody.errorString !== "") {
|
||||||
loginErrorMessage.text = signInBody.errorString;
|
loginErrorMessage.text = signUpBody.errorString;
|
||||||
errorContainer.anchors.bottom = usernameField.top;
|
errorContainer.anchors.bottom = usernameField.top;
|
||||||
|
errorContainer.anchors.bottomMargin = hifi.dimensions.contentSpacing.y;
|
||||||
errorContainer.anchors.left = usernameField.left;
|
errorContainer.anchors.left = usernameField.left;
|
||||||
}
|
}
|
||||||
loginButtonAtSignIn.text = "Sign Up";
|
|
||||||
loginButtonAtSignIn.color = hifi.buttons.blue;
|
|
||||||
emailField.placeholderText = "Email";
|
emailField.placeholderText = "Email";
|
||||||
emailField.text = "";
|
emailField.text = "";
|
||||||
emailField.anchors.top = usernameField.bottom;
|
emailField.anchors.top = usernameField.bottom;
|
||||||
|
@ -144,8 +146,8 @@ Item {
|
||||||
Text {
|
Text {
|
||||||
id: loginErrorMessage;
|
id: loginErrorMessage;
|
||||||
color: "red";
|
color: "red";
|
||||||
font.family: signInBody.fontFamily
|
font.family: signUpBody.fontFamily
|
||||||
font.pixelSize: 12
|
font.pixelSize: 18
|
||||||
verticalAlignment: Text.AlignVCenter
|
verticalAlignment: Text.AlignVCenter
|
||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
text: ""
|
text: ""
|
||||||
|
@ -156,9 +158,9 @@ Item {
|
||||||
HifiControlsUit.TextField {
|
HifiControlsUit.TextField {
|
||||||
id: usernameField
|
id: usernameField
|
||||||
width: banner.width
|
width: banner.width
|
||||||
height: signInBody.textFieldHeight
|
height: signUpBody.textFieldHeight
|
||||||
font.family: "Fira Sans"
|
|
||||||
placeholderText: "Username"
|
placeholderText: "Username"
|
||||||
|
font.pixelSize: signUpBody.textFieldFontSize
|
||||||
anchors {
|
anchors {
|
||||||
top: parent.top
|
top: parent.top
|
||||||
topMargin: 0.2 * parent.height
|
topMargin: 0.2 * parent.height
|
||||||
|
@ -189,7 +191,7 @@ Item {
|
||||||
if (keepMeLoggedInCheckbox.checked) {
|
if (keepMeLoggedInCheckbox.checked) {
|
||||||
Settings.setValue("keepMeLoggedIn/savedUsername", usernameField.text);
|
Settings.setValue("keepMeLoggedIn/savedUsername", usernameField.text);
|
||||||
}
|
}
|
||||||
signInBody.login();
|
signUpBody.login();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -202,14 +204,14 @@ Item {
|
||||||
HifiControlsUit.TextField {
|
HifiControlsUit.TextField {
|
||||||
id: emailField
|
id: emailField
|
||||||
width: banner.width
|
width: banner.width
|
||||||
height: signInBody.textFieldHeight
|
height: signUpBody.textFieldHeight
|
||||||
font.family: "Fira Sans"
|
|
||||||
anchors {
|
anchors {
|
||||||
top: parent.top
|
top: parent.top
|
||||||
left: parent.left
|
left: parent.left
|
||||||
leftMargin: (parent.width - emailField.width) / 2
|
leftMargin: (parent.width - emailField.width) / 2
|
||||||
}
|
}
|
||||||
placeholderText: "Username or Email"
|
placeholderText: "Username or Email"
|
||||||
|
font.pixelSize: signUpBody.textFieldFontSize
|
||||||
activeFocusOnPress: true
|
activeFocusOnPress: true
|
||||||
Keys.onPressed: {
|
Keys.onPressed: {
|
||||||
switch (event.key) {
|
switch (event.key) {
|
||||||
|
@ -233,7 +235,7 @@ Item {
|
||||||
if (keepMeLoggedInCheckbox.checked) {
|
if (keepMeLoggedInCheckbox.checked) {
|
||||||
Settings.setValue("keepMeLoggedIn/savedUsername", usernameField.text);
|
Settings.setValue("keepMeLoggedIn/savedUsername", usernameField.text);
|
||||||
}
|
}
|
||||||
signInBody.login();
|
signUpBody.login();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -245,9 +247,9 @@ Item {
|
||||||
HifiControlsUit.TextField {
|
HifiControlsUit.TextField {
|
||||||
id: passwordField
|
id: passwordField
|
||||||
width: banner.width
|
width: banner.width
|
||||||
height: signInBody.textFieldHeight
|
height: signUpBody.textFieldHeight
|
||||||
font.family: "Fira Sans"
|
|
||||||
placeholderText: "Password"
|
placeholderText: "Password"
|
||||||
|
font.pixelSize: signUpBody.textFieldFontSize
|
||||||
activeFocusOnPress: true
|
activeFocusOnPress: true
|
||||||
echoMode: passwordFieldMouseArea.showPassword ? TextInput.Normal : TextInput.Password
|
echoMode: passwordFieldMouseArea.showPassword ? TextInput.Normal : TextInput.Password
|
||||||
anchors {
|
anchors {
|
||||||
|
@ -318,7 +320,7 @@ Item {
|
||||||
if (keepMeLoggedInCheckbox.checked) {
|
if (keepMeLoggedInCheckbox.checked) {
|
||||||
Settings.setValue("keepMeLoggedIn/savedUsername", usernameField.text);
|
Settings.setValue("keepMeLoggedIn/savedUsername", usernameField.text);
|
||||||
}
|
}
|
||||||
signInBody.login();
|
signUpBody.login();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -328,7 +330,7 @@ Item {
|
||||||
checked: Settings.getValue("keepMeLoggedIn", false);
|
checked: Settings.getValue("keepMeLoggedIn", false);
|
||||||
text: qsTr("Keep Me Logged In");
|
text: qsTr("Keep Me Logged In");
|
||||||
boxSize: 18;
|
boxSize: 18;
|
||||||
labelFontFamily: signInBody.fontFamily
|
labelFontFamily: signUpBody.fontFamily
|
||||||
labelFontSize: 18;
|
labelFontSize: 18;
|
||||||
color: hifi.colors.white;
|
color: hifi.colors.white;
|
||||||
anchors {
|
anchors {
|
||||||
|
@ -350,9 +352,15 @@ Item {
|
||||||
Settings.setValue("keepMeLoggedIn", checked);
|
Settings.setValue("keepMeLoggedIn", checked);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Item {
|
|
||||||
id: cancelContainer
|
TextMetrics {
|
||||||
width: cancelText.width
|
id: cancelButtonTextMetrics
|
||||||
|
font: loginErrorMessage.font
|
||||||
|
text: cancelButton.text
|
||||||
|
}
|
||||||
|
HifiControlsUit.Button {
|
||||||
|
id: cancelButton
|
||||||
|
width: 1.2 * cancelButtonTextMetrics.width
|
||||||
height: d.minHeightButton
|
height: d.minHeightButton
|
||||||
anchors {
|
anchors {
|
||||||
top: keepMeLoggedInCheckbox.bottom
|
top: keepMeLoggedInCheckbox.bottom
|
||||||
|
@ -360,48 +368,31 @@ Item {
|
||||||
left: parent.left
|
left: parent.left
|
||||||
leftMargin: (parent.width - passwordField.width) / 2
|
leftMargin: (parent.width - passwordField.width) / 2
|
||||||
}
|
}
|
||||||
Text {
|
color: hifi.buttons.noneBorderlessWhite
|
||||||
id: cancelText
|
text: qsTr("CANCEL")
|
||||||
anchors.centerIn: parent
|
fontFamily: signUpBody.fontFamily
|
||||||
text: qsTr("Cancel");
|
fontSize: signUpBody.fontSize
|
||||||
|
fontBold: signUpBody.fontBold
|
||||||
lineHeight: 1
|
onClicked: {
|
||||||
color: "white"
|
bodyLoader.setSource("LinkAccountBody.qml", { "loginDialog": loginDialog, "root": root, "bodyLoader": bodyLoader });
|
||||||
font.family: signInBody.fontFamily
|
|
||||||
font.pixelSize: signInBody.fontSize
|
|
||||||
font.capitalization: Font.AllUppercase;
|
|
||||||
font.bold: signInBody.fontBold
|
|
||||||
lineHeightMode: Text.ProportionalHeight
|
|
||||||
}
|
|
||||||
MouseArea {
|
|
||||||
id: cancelArea
|
|
||||||
anchors.fill: parent
|
|
||||||
acceptedButtons: Qt.LeftButton
|
|
||||||
hoverEnabled: true
|
|
||||||
onEntered: {
|
|
||||||
Tablet.playSound(TabletEnums.ButtonHover);
|
|
||||||
}
|
|
||||||
onClicked: {
|
|
||||||
Tablet.playSound(TabletEnums.ButtonClick);
|
|
||||||
bodyLoader.setSource("LinkAccountBody.qml", { "loginDialog": loginDialog, "root": root, "bodyLoader": bodyLoader });
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
HifiControlsUit.Button {
|
HifiControlsUit.Button {
|
||||||
id: loginButtonAtSignIn
|
id: signUpButton
|
||||||
width: d.minWidthButton
|
width: d.minWidthButton
|
||||||
height: d.minHeightButton
|
height: d.minHeightButton
|
||||||
text: qsTr("Log In")
|
color: hifi.buttons.blue
|
||||||
fontFamily: signInBody.fontFamily
|
text: qsTr("Sign Up")
|
||||||
fontSize: signInBody.fontSize
|
fontFamily: signUpBody.fontFamily
|
||||||
fontBold: signInBody.fontBold
|
fontSize: signUpBody.fontSize
|
||||||
|
fontBold: signUpBody.fontBold
|
||||||
anchors {
|
anchors {
|
||||||
top: cancelContainer.top
|
top: cancelButton.top
|
||||||
right: passwordField.right
|
right: passwordField.right
|
||||||
}
|
}
|
||||||
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
signInBody.login()
|
signUpBody.login()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -426,7 +417,7 @@ Item {
|
||||||
case Qt.Key_Return:
|
case Qt.Key_Return:
|
||||||
event.accepted = true;
|
event.accepted = true;
|
||||||
Settings.setValue("keepMeLoggedIn/savedUsername", usernameField.text);
|
Settings.setValue("keepMeLoggedIn/savedUsername", usernameField.text);
|
||||||
signInBody.login();
|
signUpBody.login();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,7 +45,8 @@ Item {
|
||||||
readonly property int minWidthButton: !root.isTablet ? 256 : 174
|
readonly property int minWidthButton: !root.isTablet ? 256 : 174
|
||||||
property int maxWidth: root.isTablet ? 1280 : root.width
|
property int maxWidth: root.isTablet ? 1280 : root.width
|
||||||
readonly property int minHeight: 120
|
readonly property int minHeight: 120
|
||||||
readonly property int minHeightButton: !root.isTablet ? 56 : 42
|
// readonly property int minHeightButton: !root.isTablet ? 56 : 42
|
||||||
|
readonly property int minHeightButton: 36
|
||||||
property int maxHeight: root.isTablet ? 720 : root.height
|
property int maxHeight: root.isTablet ? 720 : root.height
|
||||||
|
|
||||||
function resize() {
|
function resize() {
|
||||||
|
|
|
@ -121,6 +121,6 @@ FocusScope {
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
keyboardTimer.start();
|
keyboardTimer.start();
|
||||||
bodyLoader.setSource("LoginDialog/LinkAccountBody.qml", { "loginDialog": loginDialog, "root": root, "bodyLoader": bodyLoader });
|
bodyLoader.setSource("LoginDialog/LinkAccountBody.qml", { "loginDialog": loginDialog, "root": root, "bodyLoader": bodyLoader, "errorString": ""});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5311,6 +5311,8 @@ void Application::resumeAfterLoginDialogActionTaken() {
|
||||||
toolbar->writeProperty("visible", true);
|
toolbar->writeProperty("visible", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
updateSystemTabletMode();
|
||||||
|
|
||||||
getMyAvatar()->setEnableMeshVisible(true);
|
getMyAvatar()->setEnableMeshVisible(true);
|
||||||
|
|
||||||
const auto& nodeList = DependencyManager::get<NodeList>();
|
const auto& nodeList = DependencyManager::get<NodeList>();
|
||||||
|
@ -8665,6 +8667,7 @@ void Application::updateLoginDialogOverlayPosition() {
|
||||||
auto overlayPositionVec = vec3FromVariant(overlayPosition.value);
|
auto overlayPositionVec = vec3FromVariant(overlayPosition.value);
|
||||||
auto cameraPositionVec = _myCamera.getPosition();
|
auto cameraPositionVec = _myCamera.getPosition();
|
||||||
auto cameraOrientation = _myCamera.getOrientation();
|
auto cameraOrientation = _myCamera.getOrientation();
|
||||||
|
cameraOrientation = cancelOutRollAndPitch(cameraOrientation);
|
||||||
auto headLookVec = (cameraOrientation * Vectors::FRONT);
|
auto headLookVec = (cameraOrientation * Vectors::FRONT);
|
||||||
auto overlayToHeadVec = overlayPositionVec - cameraPositionVec;
|
auto overlayToHeadVec = overlayPositionVec - cameraPositionVec;
|
||||||
auto pointAngle = (glm::acos(glm::dot(glm::normalize(overlayToHeadVec), glm::normalize(headLookVec))) * 180.0f / PI);
|
auto pointAngle = (glm::acos(glm::dot(glm::normalize(overlayToHeadVec), glm::normalize(headLookVec))) * 180.0f / PI);
|
||||||
|
|
|
@ -193,29 +193,7 @@ void LoginDialog::createAccountFromSteam(QString username) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void LoginDialog::openUrl(const QString& url) const {
|
void LoginDialog::openUrl(const QString& url) const {
|
||||||
auto tablet = dynamic_cast<TabletProxy*>(DependencyManager::get<TabletScriptingInterface>()->getTablet("com.highfidelity.interface.tablet.system"));
|
QDesktopServices::openUrl(QUrl(url));
|
||||||
auto hmd = DependencyManager::get<HMDScriptingInterface>();
|
|
||||||
auto offscreenUi = DependencyManager::get<OffscreenUi>();
|
|
||||||
|
|
||||||
if (tablet->getToolbarMode()) {
|
|
||||||
offscreenUi->load("Browser.qml", [=](QQmlContext* context, QObject* newObject) {
|
|
||||||
newObject->setProperty("url", url);
|
|
||||||
});
|
|
||||||
if (!qApp->getLoginDialogPoppedUp()) {
|
|
||||||
LoginDialog::hide();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (!hmd->getShouldShowTablet() && !qApp->isHMDMode()) {
|
|
||||||
offscreenUi->load("Browser.qml", [=](QQmlContext* context, QObject* newObject) {
|
|
||||||
newObject->setProperty("url", url);
|
|
||||||
});
|
|
||||||
if (!qApp->getLoginDialogPoppedUp()) {
|
|
||||||
LoginDialog::hide();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
tablet->gotoWebScreen(url);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void LoginDialog::linkCompleted(QNetworkReply* reply) {
|
void LoginDialog::linkCompleted(QNetworkReply* reply) {
|
||||||
|
|
Loading…
Reference in a new issue