Merge branch 'loginInitiative2' of https://github.com/wayne-chen/hifi into loginInitiative2

This commit is contained in:
Wayne Chen 2018-12-06 09:05:07 -08:00
commit 89a216a5ec
14 changed files with 70 additions and 91 deletions

View file

@ -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"
}

View file

@ -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 {

View file

@ -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: {

View file

@ -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: {

View file

@ -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")

Binary file not shown.

Before

Width:  |  Height:  |  Size: 315 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 960 KiB

View file

Before

Width:  |  Height:  |  Size: 272 KiB

After

Width:  |  Height:  |  Size: 272 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 281 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

View file

@ -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"
}

View file

@ -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"
}

View file

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