Merge branch 'loginInitiative2' of https://github.com/wayne-chen/hifi into loginInitiative2
|
@ -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"
|
||||
}
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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: {
|
||||
|
|
|
@ -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: {
|
||||
|
|
|
@ -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")
|
||||
|
|
Before Width: | Height: | Size: 315 KiB |
BIN
interface/resources/qml/LoginDialog/images/background.jpg
Normal file
After Width: | Height: | Size: 960 KiB |
Before Width: | Height: | Size: 272 KiB After Width: | Height: | Size: 272 KiB |
Before Width: | Height: | Size: 58 KiB |
After Width: | Height: | Size: 281 KiB |
Before Width: | Height: | Size: 49 KiB |
|
@ -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"
|
||||
}
|
||||
|
||||
|
|
|
@ -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"
|
||||
}
|
||||
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
|
|