mirror of
https://github.com/overte-org/overte.git
synced 2025-06-25 00:29:32 +02:00
login UI first draft
This commit is contained in:
parent
cea0e182c0
commit
205df0cf51
28 changed files with 1321 additions and 347 deletions
|
@ -10,320 +10,91 @@
|
||||||
|
|
||||||
import Hifi 1.0
|
import Hifi 1.0
|
||||||
import QtQuick 2.4
|
import QtQuick 2.4
|
||||||
import "controls"
|
|
||||||
import "styles"
|
import "controls-uit"
|
||||||
|
import "styles-uit"
|
||||||
import "windows"
|
import "windows"
|
||||||
|
|
||||||
ScrollingWindow {
|
import "LoginDialog"
|
||||||
|
|
||||||
|
ModalWindow {
|
||||||
id: root
|
id: root
|
||||||
HifiConstants { id: hifi }
|
HifiConstants { id: hifi }
|
||||||
objectName: "LoginDialog"
|
objectName: "LoginDialog"
|
||||||
height: loginDialog.implicitHeight
|
implicitWidth: 520
|
||||||
width: loginDialog.implicitWidth
|
implicitHeight: 320
|
||||||
// FIXME make movable
|
destroyOnCloseButton: true
|
||||||
anchors.centerIn: parent
|
destroyOnHidden: true
|
||||||
destroyOnHidden: false
|
visible: true
|
||||||
hideBackground: true
|
|
||||||
shown: false
|
property string iconText: ""
|
||||||
|
property int iconSize: 50
|
||||||
|
|
||||||
|
property string title: ""
|
||||||
|
property int titleWidth: 0
|
||||||
|
|
||||||
|
Component {
|
||||||
|
id: signInBody
|
||||||
|
SignInBody {}
|
||||||
|
}
|
||||||
|
Component {
|
||||||
|
id: welcomeBody
|
||||||
|
WelcomeBody {}
|
||||||
|
}
|
||||||
|
|
||||||
LoginDialog {
|
LoginDialog {
|
||||||
id: loginDialog
|
id: loginDialog
|
||||||
implicitWidth: backgroundRectangle.width
|
|
||||||
implicitHeight: backgroundRectangle.height
|
|
||||||
readonly property int inputWidth: 500
|
|
||||||
readonly property int inputHeight: 60
|
|
||||||
readonly property int borderWidth: 30
|
|
||||||
readonly property int closeMargin: 16
|
|
||||||
readonly property real tan30: 0.577 // tan(30°)
|
|
||||||
readonly property int inputSpacing: 16
|
|
||||||
|
|
||||||
Rectangle {
|
Loader {
|
||||||
id: backgroundRectangle
|
id: bodyLoader
|
||||||
width: loginDialog.inputWidth + loginDialog.borderWidth * 2
|
anchors.fill: parent
|
||||||
height: loginDialog.inputHeight * 6 + loginDialog.closeMargin * 2
|
sourceComponent: signInBody
|
||||||
radius: loginDialog.closeMargin * 2
|
|
||||||
color: "#2c86b1"
|
|
||||||
opacity: 0.85
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Column {
|
Connections {
|
||||||
id: mainContent
|
target: loginDialog
|
||||||
width: loginDialog.inputWidth
|
onHandleLoginCompleted: {
|
||||||
spacing: loginDialog.inputSpacing
|
console.log("Login Succeeded")
|
||||||
anchors {
|
bodyLoader.sourceComponent = welcomeBody
|
||||||
horizontalCenter: parent.horizontalCenter
|
bodyLoader.active = true
|
||||||
verticalCenter: parent.verticalCenter
|
|
||||||
}
|
}
|
||||||
|
onHandleLoginFailed: {
|
||||||
Item {
|
console.log("Login Failed")
|
||||||
// Offset content down a little
|
|
||||||
width: loginDialog.inputWidth
|
|
||||||
height: loginDialog.closeMargin
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
width: loginDialog.inputWidth
|
|
||||||
height: loginDialog.inputHeight
|
|
||||||
radius: height / 2
|
|
||||||
color: "#ebebeb"
|
|
||||||
|
|
||||||
Image {
|
|
||||||
source: "../images/login-username.svg"
|
|
||||||
width: loginDialog.inputHeight * 0.65
|
|
||||||
height: width
|
|
||||||
sourceSize: Qt.size(width, height);
|
|
||||||
anchors {
|
|
||||||
verticalCenter: parent.verticalCenter
|
|
||||||
left: parent.left
|
|
||||||
leftMargin: loginDialog.inputHeight / 4
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
TextInput {
|
|
||||||
id: username
|
|
||||||
anchors {
|
|
||||||
fill: parent
|
|
||||||
leftMargin: loginDialog.inputHeight
|
|
||||||
rightMargin: loginDialog.inputHeight / 2
|
|
||||||
}
|
|
||||||
|
|
||||||
helperText: "username or email"
|
|
||||||
color: hifi.colors.text
|
|
||||||
|
|
||||||
KeyNavigation.tab: password
|
|
||||||
KeyNavigation.backtab: password
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
width: loginDialog.inputWidth
|
|
||||||
height: loginDialog.inputHeight
|
|
||||||
radius: height / 2
|
|
||||||
color: "#ebebeb"
|
|
||||||
|
|
||||||
Image {
|
|
||||||
source: "../images/login-password.svg"
|
|
||||||
width: loginDialog.inputHeight * 0.65
|
|
||||||
height: width
|
|
||||||
sourceSize: Qt.size(width, height);
|
|
||||||
anchors {
|
|
||||||
verticalCenter: parent.verticalCenter
|
|
||||||
left: parent.left
|
|
||||||
leftMargin: loginDialog.inputHeight / 4
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
TextInput {
|
|
||||||
id: password
|
|
||||||
anchors {
|
|
||||||
fill: parent
|
|
||||||
leftMargin: loginDialog.inputHeight
|
|
||||||
rightMargin: loginDialog.inputHeight / 2
|
|
||||||
}
|
|
||||||
|
|
||||||
helperText: "password"
|
|
||||||
echoMode: TextInput.Password
|
|
||||||
color: hifi.colors.text
|
|
||||||
|
|
||||||
KeyNavigation.tab: username
|
|
||||||
KeyNavigation.backtab: username
|
|
||||||
onFocusChanged: {
|
|
||||||
if (password.focus) {
|
|
||||||
password.selectAll()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Item {
|
|
||||||
width: loginDialog.inputWidth
|
|
||||||
height: loginDialog.inputHeight / 2
|
|
||||||
|
|
||||||
Text {
|
|
||||||
id: messageText
|
|
||||||
|
|
||||||
visible: loginDialog.statusText != "" && loginDialog.statusText != "Logging in..."
|
|
||||||
|
|
||||||
width: loginDialog.inputWidth
|
|
||||||
height: loginDialog.inputHeight / 2
|
|
||||||
horizontalAlignment: Text.AlignHCenter
|
|
||||||
verticalAlignment: Text.AlignVCenter
|
|
||||||
|
|
||||||
text: loginDialog.statusText
|
|
||||||
color: "white"
|
|
||||||
}
|
|
||||||
|
|
||||||
Row {
|
|
||||||
id: messageSpinner
|
|
||||||
|
|
||||||
visible: loginDialog.statusText == "Logging in..."
|
|
||||||
onVisibleChanged: visible ? messageSpinnerAnimation.restart() : messageSpinnerAnimation.stop()
|
|
||||||
|
|
||||||
spacing: 24
|
|
||||||
anchors {
|
|
||||||
verticalCenter: parent.verticalCenter
|
|
||||||
horizontalCenter: parent.horizontalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
id: spinner1
|
|
||||||
width: 10
|
|
||||||
height: 10
|
|
||||||
color: "#ebebeb"
|
|
||||||
opacity: 0.05
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
id: spinner2
|
|
||||||
width: 10
|
|
||||||
height: 10
|
|
||||||
color: "#ebebeb"
|
|
||||||
opacity: 0.05
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
id: spinner3
|
|
||||||
width: 10
|
|
||||||
height: 10
|
|
||||||
color: "#ebebeb"
|
|
||||||
opacity: 0.05
|
|
||||||
}
|
|
||||||
|
|
||||||
SequentialAnimation {
|
|
||||||
id: messageSpinnerAnimation
|
|
||||||
running: messageSpinner.visible
|
|
||||||
loops: Animation.Infinite
|
|
||||||
NumberAnimation { target: spinner1; property: "opacity"; to: 1.0; duration: 1000 }
|
|
||||||
NumberAnimation { target: spinner2; property: "opacity"; to: 1.0; duration: 1000 }
|
|
||||||
NumberAnimation { target: spinner3; property: "opacity"; to: 1.0; duration: 1000 }
|
|
||||||
NumberAnimation { target: spinner1; property: "opacity"; to: 0.05; duration: 0 }
|
|
||||||
NumberAnimation { target: spinner2; property: "opacity"; to: 0.05; duration: 0 }
|
|
||||||
NumberAnimation { target: spinner3; property: "opacity"; to: 0.05; duration: 0 }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Row {
|
|
||||||
width: loginDialog.inputWidth
|
|
||||||
height: loginDialog.inputHeight
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
width: loginDialog.inputWidth / 3
|
|
||||||
height: loginDialog.inputHeight
|
|
||||||
radius: height / 2
|
|
||||||
color: "#353535"
|
|
||||||
|
|
||||||
TextInput {
|
|
||||||
anchors.fill: parent
|
|
||||||
text: "Login"
|
|
||||||
color: "white"
|
|
||||||
horizontalAlignment: Text.AlignHCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
anchors.fill: parent
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
|
||||||
onClicked: {
|
|
||||||
loginDialog.login(username.text, password.text)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Image {
|
|
||||||
source: "../images/steam-sign-in.png"
|
|
||||||
width: loginDialog.inputWidth / 3
|
|
||||||
height: loginDialog.inputHeight
|
|
||||||
anchors {
|
|
||||||
verticalCenter: parent.verticalCenter
|
|
||||||
right: parent.right
|
|
||||||
leftMargin: loginDialog.inputHeight / 4
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
anchors.fill: parent
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
|
||||||
onClicked: {
|
|
||||||
loginDialog.loginThroughSteam()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Item {
|
|
||||||
anchors { left: parent.left; right: parent.right; }
|
|
||||||
height: loginDialog.inputHeight
|
|
||||||
|
|
||||||
Image {
|
|
||||||
id: hifiIcon
|
|
||||||
source: "../images/hifi-logo-blackish.svg"
|
|
||||||
width: loginDialog.inputHeight
|
|
||||||
height: width
|
|
||||||
sourceSize: Qt.size(width, height);
|
|
||||||
anchors { verticalCenter: parent.verticalCenter; horizontalCenter: parent.horizontalCenter }
|
|
||||||
}
|
|
||||||
|
|
||||||
Text {
|
|
||||||
anchors { verticalCenter: parent.verticalCenter; right: hifiIcon.left; margins: loginDialog.inputSpacing }
|
|
||||||
text: "Password?"
|
|
||||||
scale: 0.8
|
|
||||||
font.underline: true
|
|
||||||
color: "#e0e0e0"
|
|
||||||
MouseArea {
|
|
||||||
anchors { fill: parent; margins: -loginDialog.inputSpacing / 2 }
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
|
||||||
onClicked: loginDialog.openUrl(loginDialog.rootUrl + "/users/password/new")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Text {
|
|
||||||
anchors { verticalCenter: parent.verticalCenter; left: hifiIcon.right; margins: loginDialog.inputSpacing }
|
|
||||||
text: "Register"
|
|
||||||
scale: 0.8
|
|
||||||
font.underline: true
|
|
||||||
color: "#e0e0e0"
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
anchors { fill: parent; margins: -loginDialog.inputSpacing / 2 }
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
|
||||||
onClicked: loginDialog.openUrl(loginDialog.rootUrl + "/signup")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
onShownChanged: {
|
|
||||||
if (!shown) {
|
|
||||||
username.text = ""
|
|
||||||
password.text = ""
|
|
||||||
loginDialog.statusText = ""
|
|
||||||
} else {
|
|
||||||
username.forceActiveFocus()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Keys.onPressed: {
|
Keys.onPressed: {
|
||||||
switch (event.key) {
|
if (!visible) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (event.modifiers === Qt.ControlModifier)
|
||||||
|
switch (event.key) {
|
||||||
|
case Qt.Key_A:
|
||||||
|
event.accepted = true
|
||||||
|
detailedText.selectAll()
|
||||||
|
break
|
||||||
|
case Qt.Key_C:
|
||||||
|
event.accepted = true
|
||||||
|
detailedText.copy()
|
||||||
|
break
|
||||||
|
case Qt.Key_Period:
|
||||||
|
if (Qt.platform.os === "osx") {
|
||||||
|
event.accepted = true
|
||||||
|
content.reject()
|
||||||
|
}
|
||||||
|
break
|
||||||
|
} else switch (event.key) {
|
||||||
case Qt.Key_Escape:
|
case Qt.Key_Escape:
|
||||||
case Qt.Key_Back:
|
case Qt.Key_Back:
|
||||||
root.shown = false;
|
event.accepted = true
|
||||||
event.accepted = true;
|
destroy()
|
||||||
break;
|
break
|
||||||
|
|
||||||
case Qt.Key_Enter:
|
case Qt.Key_Enter:
|
||||||
case Qt.Key_Return:
|
case Qt.Key_Return:
|
||||||
if (username.activeFocus) {
|
event.accepted = true
|
||||||
event.accepted = true
|
|
||||||
password.forceActiveFocus()
|
|
||||||
} else if (password.activeFocus) {
|
|
||||||
event.accepted = true
|
|
||||||
if (username.text == "") {
|
|
||||||
username.forceActiveFocus()
|
|
||||||
} else {
|
|
||||||
loginDialog.login(username.text, password.text)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
93
interface/resources/qml/LoginDialog/CompleteProfileBody.qml
Normal file
93
interface/resources/qml/LoginDialog/CompleteProfileBody.qml
Normal file
|
@ -0,0 +1,93 @@
|
||||||
|
//
|
||||||
|
// CompleteProfileBody.qml
|
||||||
|
//
|
||||||
|
// Created by Clement on 7/18/16
|
||||||
|
// Copyright 2015 High Fidelity, Inc.
|
||||||
|
//
|
||||||
|
// Distributed under the Apache License, Version 2.0.
|
||||||
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
|
//
|
||||||
|
|
||||||
|
import Hifi 1.0
|
||||||
|
import QtQuick 2.4
|
||||||
|
import QtQuick.Controls.Styles 1.4 as OriginalStyles
|
||||||
|
|
||||||
|
import "../controls-uit"
|
||||||
|
import "../styles-uit"
|
||||||
|
|
||||||
|
Item {
|
||||||
|
id: completeProfileBody
|
||||||
|
clip: true
|
||||||
|
width: pane.width
|
||||||
|
height: pane.height
|
||||||
|
|
||||||
|
QtObject {
|
||||||
|
id: d
|
||||||
|
readonly property int minWidth: 480
|
||||||
|
readonly property int maxWidth: 1280
|
||||||
|
readonly property int minHeight: 120
|
||||||
|
readonly property int maxHeight: 720
|
||||||
|
|
||||||
|
function resize() {
|
||||||
|
var targetWidth = Math.max(titleWidth, additionalTextContainer.contentWidth)
|
||||||
|
var targetHeight = 4 * hifi.dimensions.contentSpacing.y + buttons.height + additionalTextContainer.height
|
||||||
|
|
||||||
|
root.width = Math.max(d.minWidth, Math.min(d.maxWidth, targetWidth))
|
||||||
|
root.height = Math.max(d.minHeight, Math.min(d.maxHeight, targetHeight))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Row {
|
||||||
|
id: buttons
|
||||||
|
anchors {
|
||||||
|
top: parent.top
|
||||||
|
horizontalCenter: parent.horizontalCenter
|
||||||
|
margins: 0
|
||||||
|
topMargin: 3 * hifi.dimensions.contentSpacing.y
|
||||||
|
}
|
||||||
|
spacing: hifi.dimensions.contentSpacing.x
|
||||||
|
onHeightChanged: d.resize(); onWidthChanged: d.resize();
|
||||||
|
|
||||||
|
Button {
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
width: 200
|
||||||
|
|
||||||
|
text: qsTr("Create your profile")
|
||||||
|
color: hifi.buttons.blue
|
||||||
|
}
|
||||||
|
|
||||||
|
Button {
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
|
||||||
|
text: qsTr("Cancel")
|
||||||
|
|
||||||
|
|
||||||
|
onClicked: root.destroy()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ShortcutText {
|
||||||
|
id: additionalTextContainer
|
||||||
|
anchors {
|
||||||
|
top: buttons.bottom
|
||||||
|
horizontalCenter: parent.horizontalCenter
|
||||||
|
margins: 0
|
||||||
|
topMargin: hifi.dimensions.contentSpacing.y
|
||||||
|
}
|
||||||
|
|
||||||
|
text: "Already have a High Fidelity profile? Link to an existing profile here."
|
||||||
|
|
||||||
|
font.underline: true
|
||||||
|
wrapMode: Text.WordWrap
|
||||||
|
color: hifi.colors.blueAccent
|
||||||
|
lineHeight: 2
|
||||||
|
lineHeightMode: Text.ProportionalHeight
|
||||||
|
horizontalAlignment: Text.AlignHCenter
|
||||||
|
}
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
root.title = qsTr("Complete Your Profile")
|
||||||
|
root.iconText = "<"
|
||||||
|
d.resize();
|
||||||
|
}
|
||||||
|
}
|
83
interface/resources/qml/LoginDialog/EmailSentBody.qml
Normal file
83
interface/resources/qml/LoginDialog/EmailSentBody.qml
Normal file
|
@ -0,0 +1,83 @@
|
||||||
|
//
|
||||||
|
// EmailSentBody.qml
|
||||||
|
//
|
||||||
|
// Created by Clement on 7/18/16
|
||||||
|
// Copyright 2015 High Fidelity, Inc.
|
||||||
|
//
|
||||||
|
// Distributed under the Apache License, Version 2.0.
|
||||||
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
|
//
|
||||||
|
|
||||||
|
import Hifi 1.0
|
||||||
|
import QtQuick 2.4
|
||||||
|
|
||||||
|
import "../controls-uit"
|
||||||
|
import "../styles-uit"
|
||||||
|
|
||||||
|
Item {
|
||||||
|
id: emailSentBody
|
||||||
|
clip: true
|
||||||
|
width: pane.width
|
||||||
|
height: pane.height
|
||||||
|
|
||||||
|
property string email: "clement@highfidelity.com"
|
||||||
|
|
||||||
|
QtObject {
|
||||||
|
id: d
|
||||||
|
readonly property int minWidth: 480
|
||||||
|
readonly property int maxWidth: 1280
|
||||||
|
readonly property int minHeight: 120
|
||||||
|
readonly property int maxHeight: 720
|
||||||
|
|
||||||
|
function resize() {
|
||||||
|
var targetWidth = Math.max(titleWidth, mainTextContainer.contentWidth)
|
||||||
|
var targetHeight = mainTextContainer.height + 3 * hifi.dimensions.contentSpacing.y + buttons.height
|
||||||
|
|
||||||
|
root.width = Math.max(d.minWidth, Math.min(d.maxWidth, targetWidth))
|
||||||
|
root.height = Math.max(d.minHeight, Math.min(d.maxHeight, targetHeight))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
MenuItem {
|
||||||
|
id: mainTextContainer
|
||||||
|
anchors {
|
||||||
|
top: parent.top
|
||||||
|
horizontalCenter: parent.horizontalCenter
|
||||||
|
margins: 0
|
||||||
|
topMargin: hifi.dimensions.contentSpacing.y
|
||||||
|
}
|
||||||
|
|
||||||
|
text: qsTr("An email with instructions on reseting your password was sent to <br/><b>") + email + "</b>"
|
||||||
|
wrapMode: Text.WordWrap
|
||||||
|
color: hifi.colors.baseGrayHighlight
|
||||||
|
lineHeight: 2
|
||||||
|
lineHeightMode: Text.ProportionalHeight
|
||||||
|
horizontalAlignment: Text.AlignHCenter
|
||||||
|
}
|
||||||
|
|
||||||
|
Row {
|
||||||
|
id: buttons
|
||||||
|
anchors {
|
||||||
|
top: mainTextContainer.bottom
|
||||||
|
horizontalCenter: parent.horizontalCenter
|
||||||
|
margins: 0
|
||||||
|
topMargin: 2 * hifi.dimensions.contentSpacing.y
|
||||||
|
}
|
||||||
|
spacing: hifi.dimensions.contentSpacing.x
|
||||||
|
onHeightChanged: d.resize(); onWidthChanged: d.resize();
|
||||||
|
|
||||||
|
Button {
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
|
||||||
|
text: qsTr("Close");
|
||||||
|
|
||||||
|
onClicked: root.destroy()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
root.title = qsTr("Email Sent")
|
||||||
|
root.iconText = ""
|
||||||
|
d.resize();
|
||||||
|
}
|
||||||
|
}
|
165
interface/resources/qml/LoginDialog/LinkAccountBody.qml
Normal file
165
interface/resources/qml/LoginDialog/LinkAccountBody.qml
Normal file
|
@ -0,0 +1,165 @@
|
||||||
|
//
|
||||||
|
// LinkAccountBody.qml
|
||||||
|
//
|
||||||
|
// Created by Clement on 7/18/16
|
||||||
|
// Copyright 2015 High Fidelity, Inc.
|
||||||
|
//
|
||||||
|
// Distributed under the Apache License, Version 2.0.
|
||||||
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
|
//
|
||||||
|
|
||||||
|
import Hifi 1.0
|
||||||
|
import QtQuick 2.4
|
||||||
|
import QtQuick.Controls 1.4
|
||||||
|
import QtQuick.Controls.Styles 1.4 as OriginalStyles
|
||||||
|
|
||||||
|
import "../controls-uit"
|
||||||
|
import "../styles-uit"
|
||||||
|
|
||||||
|
Item {
|
||||||
|
id: linkAccountBody
|
||||||
|
clip: true
|
||||||
|
width: pane.width
|
||||||
|
height: pane.height
|
||||||
|
|
||||||
|
property bool existingEmail: true
|
||||||
|
|
||||||
|
QtObject {
|
||||||
|
id: d
|
||||||
|
readonly property int minWidth: 480
|
||||||
|
readonly property int maxWidth: 1280
|
||||||
|
readonly property int minHeight: 120
|
||||||
|
readonly property int maxHeight: 720
|
||||||
|
|
||||||
|
function resize() {
|
||||||
|
var targetWidth = Math.max(titleWidth, mainTextContainer.visible ? mainTextContainer.contentWidth : 0)
|
||||||
|
var targetHeight = (mainTextContainer.visible ? mainTextContainer.height : 0) +
|
||||||
|
4 * hifi.dimensions.contentSpacing.y + form.height +
|
||||||
|
4 * hifi.dimensions.contentSpacing.y + buttons.height
|
||||||
|
|
||||||
|
root.width = Math.max(d.minWidth, Math.min(d.maxWidth, targetWidth))
|
||||||
|
root.height = Math.max(d.minHeight, Math.min(d.maxHeight, targetHeight))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
MenuItem {
|
||||||
|
id: mainTextContainer
|
||||||
|
anchors {
|
||||||
|
top: parent.top
|
||||||
|
horizontalCenter: parent.horizontalCenter
|
||||||
|
margins: 0
|
||||||
|
topMargin: hifi.dimensions.contentSpacing.y
|
||||||
|
}
|
||||||
|
visible: existingEmail
|
||||||
|
|
||||||
|
text: qsTr("Your Steam account's email matches an existing High Fidelity Profile")
|
||||||
|
wrapMode: Text.WordWrap
|
||||||
|
color: hifi.colors.redAccent
|
||||||
|
lineHeight: 2
|
||||||
|
lineHeightMode: Text.ProportionalHeight
|
||||||
|
horizontalAlignment: Text.AlignHCenter
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Column {
|
||||||
|
id: form
|
||||||
|
anchors {
|
||||||
|
top: mainTextContainer.bottom
|
||||||
|
left: parent.left
|
||||||
|
margins: 0
|
||||||
|
topMargin: 2 * hifi.dimensions.contentSpacing.y
|
||||||
|
}
|
||||||
|
spacing: 2 * hifi.dimensions.contentSpacing.y
|
||||||
|
|
||||||
|
Row {
|
||||||
|
spacing: hifi.dimensions.contentSpacing.x
|
||||||
|
|
||||||
|
TextField {
|
||||||
|
id: usernameField
|
||||||
|
anchors {
|
||||||
|
verticalCenter: parent.verticalCenter
|
||||||
|
}
|
||||||
|
width: 350
|
||||||
|
|
||||||
|
label: "User Name or Email"
|
||||||
|
}
|
||||||
|
|
||||||
|
ShortcutText {
|
||||||
|
anchors {
|
||||||
|
verticalCenter: parent.verticalCenter
|
||||||
|
}
|
||||||
|
|
||||||
|
text: "Need help?"
|
||||||
|
|
||||||
|
color: hifi.colors.blueAccent
|
||||||
|
font.underline: true
|
||||||
|
|
||||||
|
verticalAlignment: Text.AlignVCenter
|
||||||
|
horizontalAlignment: Text.AlignHCenter
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Row {
|
||||||
|
spacing: hifi.dimensions.contentSpacing.x
|
||||||
|
|
||||||
|
TextField {
|
||||||
|
id: passwordField
|
||||||
|
anchors {
|
||||||
|
verticalCenter: parent.verticalCenter
|
||||||
|
}
|
||||||
|
width: 350
|
||||||
|
|
||||||
|
label: "Password"
|
||||||
|
echoMode: TextInput.Password
|
||||||
|
}
|
||||||
|
|
||||||
|
ShortcutText {
|
||||||
|
anchors {
|
||||||
|
verticalCenter: parent.verticalCenter
|
||||||
|
}
|
||||||
|
|
||||||
|
text: "Need help?"
|
||||||
|
|
||||||
|
color: hifi.colors.blueAccent
|
||||||
|
font.underline: true
|
||||||
|
|
||||||
|
verticalAlignment: Text.AlignVCenter
|
||||||
|
horizontalAlignment: Text.AlignHCenter
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
Row {
|
||||||
|
id: buttons
|
||||||
|
anchors {
|
||||||
|
top: form.bottom
|
||||||
|
right: parent.right
|
||||||
|
margins: 0
|
||||||
|
topMargin: 3 * hifi.dimensions.contentSpacing.y
|
||||||
|
}
|
||||||
|
spacing: hifi.dimensions.contentSpacing.x
|
||||||
|
onHeightChanged: d.resize(); onWidthChanged: d.resize();
|
||||||
|
|
||||||
|
Button {
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
width: 200
|
||||||
|
|
||||||
|
text: qsTr("Link Account")
|
||||||
|
color: hifi.buttons.blue
|
||||||
|
}
|
||||||
|
|
||||||
|
Button {
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
|
||||||
|
text: qsTr("Cancel")
|
||||||
|
|
||||||
|
onClicked: root.destroy()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
root.title = qsTr("Sign Into High Fidelity")
|
||||||
|
root.iconText = "<"
|
||||||
|
d.resize();
|
||||||
|
}
|
||||||
|
}
|
106
interface/resources/qml/LoginDialog/RecoverPasswordBody.qml
Normal file
106
interface/resources/qml/LoginDialog/RecoverPasswordBody.qml
Normal file
|
@ -0,0 +1,106 @@
|
||||||
|
//
|
||||||
|
// RecoverPasswordBody.qml
|
||||||
|
//
|
||||||
|
// Created by Clement on 7/18/16
|
||||||
|
// Copyright 2015 High Fidelity, Inc.
|
||||||
|
//
|
||||||
|
// Distributed under the Apache License, Version 2.0.
|
||||||
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
|
//
|
||||||
|
|
||||||
|
import Hifi 1.0
|
||||||
|
import QtQuick 2.4
|
||||||
|
import QtQuick.Controls 1.4
|
||||||
|
import QtQuick.Controls.Styles 1.4 as OriginalStyles
|
||||||
|
|
||||||
|
import "../controls-uit"
|
||||||
|
import "../styles-uit"
|
||||||
|
|
||||||
|
Item {
|
||||||
|
id: recoverPasswordBody
|
||||||
|
clip: true
|
||||||
|
width: pane.width
|
||||||
|
height: pane.height
|
||||||
|
|
||||||
|
QtObject {
|
||||||
|
id: d
|
||||||
|
readonly property int minWidth: 480
|
||||||
|
readonly property int maxWidth: 1280
|
||||||
|
readonly property int minHeight: 120
|
||||||
|
readonly property int maxHeight: 720
|
||||||
|
|
||||||
|
function resize() {
|
||||||
|
var targetWidth = Math.max(titleWidth, mainTextContainer.contentWidth)
|
||||||
|
var targetHeight = mainTextContainer.height +
|
||||||
|
3 * hifi.dimensions.contentSpacing.y + emailField.height +
|
||||||
|
4 * hifi.dimensions.contentSpacing.y + buttons.height
|
||||||
|
|
||||||
|
root.width = Math.max(d.minWidth, Math.min(d.maxWidth, targetWidth))
|
||||||
|
root.height = Math.max(d.minHeight, Math.min(d.maxHeight, targetHeight))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
MenuItem {
|
||||||
|
id: mainTextContainer
|
||||||
|
anchors {
|
||||||
|
top: parent.top
|
||||||
|
left: parent.left
|
||||||
|
right: parent.right
|
||||||
|
margins: 0
|
||||||
|
topMargin: hifi.dimensions.contentSpacing.y
|
||||||
|
}
|
||||||
|
|
||||||
|
text: qsTr("In order to help you reset your password, we will send an<br/>email with instructions to your email address.")
|
||||||
|
wrapMode: Text.WordWrap
|
||||||
|
color: hifi.colors.baseGrayHighlight
|
||||||
|
lineHeight: 1
|
||||||
|
horizontalAlignment: Text.AlignHLeft
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
TextField {
|
||||||
|
id: emailField
|
||||||
|
anchors {
|
||||||
|
top: mainTextContainer.bottom
|
||||||
|
left: parent.left
|
||||||
|
margins: 0
|
||||||
|
topMargin: 2 * hifi.dimensions.contentSpacing.y
|
||||||
|
}
|
||||||
|
|
||||||
|
width: 350
|
||||||
|
|
||||||
|
label: "Email address"
|
||||||
|
}
|
||||||
|
|
||||||
|
Row {
|
||||||
|
id: buttons
|
||||||
|
anchors {
|
||||||
|
top: emailField.bottom
|
||||||
|
right: parent.right
|
||||||
|
margins: 0
|
||||||
|
topMargin: 3 * hifi.dimensions.contentSpacing.y
|
||||||
|
}
|
||||||
|
spacing: hifi.dimensions.contentSpacing.x
|
||||||
|
onHeightChanged: d.resize(); onWidthChanged: d.resize();
|
||||||
|
|
||||||
|
Button {
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
width: 200
|
||||||
|
|
||||||
|
text: qsTr("Send recovery email")
|
||||||
|
color: hifi.buttons.blue
|
||||||
|
}
|
||||||
|
|
||||||
|
Button {
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
|
||||||
|
text: qsTr("Back")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
root.title = qsTr("Recover Password")
|
||||||
|
root.iconText = "<"
|
||||||
|
d.resize();
|
||||||
|
}
|
||||||
|
}
|
110
interface/resources/qml/LoginDialog/SignInBody.qml
Normal file
110
interface/resources/qml/LoginDialog/SignInBody.qml
Normal file
|
@ -0,0 +1,110 @@
|
||||||
|
//
|
||||||
|
// SignInBody.qml
|
||||||
|
//
|
||||||
|
// Created by Clement on 7/18/16
|
||||||
|
// Copyright 2015 High Fidelity, Inc.
|
||||||
|
//
|
||||||
|
// Distributed under the Apache License, Version 2.0.
|
||||||
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
|
//
|
||||||
|
|
||||||
|
import Hifi 1.0
|
||||||
|
import QtQuick 2.4
|
||||||
|
import QtQuick.Controls.Styles 1.4 as OriginalStyles
|
||||||
|
|
||||||
|
import "../controls-uit"
|
||||||
|
import "../styles-uit"
|
||||||
|
|
||||||
|
Item {
|
||||||
|
id: signInBody
|
||||||
|
clip: true
|
||||||
|
width: pane.width
|
||||||
|
height: pane.height
|
||||||
|
|
||||||
|
property bool required: false
|
||||||
|
|
||||||
|
function login() {
|
||||||
|
console.log("Trying to log in")
|
||||||
|
loginDialog.loginThroughSteam()
|
||||||
|
}
|
||||||
|
|
||||||
|
function cancel() {
|
||||||
|
root.destroy()
|
||||||
|
}
|
||||||
|
|
||||||
|
QtObject {
|
||||||
|
id: d
|
||||||
|
readonly property int minWidth: 480
|
||||||
|
readonly property int maxWidth: 1280
|
||||||
|
readonly property int minHeight: 120
|
||||||
|
readonly property int maxHeight: 720
|
||||||
|
|
||||||
|
function resize() {
|
||||||
|
var targetWidth = Math.max(titleWidth, mainTextContainer.contentWidth)
|
||||||
|
var targetHeight = mainTextContainer.height + 3 * hifi.dimensions.contentSpacing.y + buttons.height
|
||||||
|
|
||||||
|
root.width = Math.max(d.minWidth, Math.min(d.maxWidth, targetWidth))
|
||||||
|
root.height = Math.max(d.minHeight, Math.min(d.maxHeight, targetHeight))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
MenuItem {
|
||||||
|
id: mainTextContainer
|
||||||
|
anchors {
|
||||||
|
top: parent.top
|
||||||
|
horizontalCenter: parent.horizontalCenter
|
||||||
|
margins: 0
|
||||||
|
topMargin: hifi.dimensions.contentSpacing.y
|
||||||
|
}
|
||||||
|
|
||||||
|
text: required ? qsTr("This domain's owner requires that you sign in:")
|
||||||
|
: qsTr("Sign in to access your user account:")
|
||||||
|
wrapMode: Text.WordWrap
|
||||||
|
color: hifi.colors.baseGrayHighlight
|
||||||
|
lineHeight: 2
|
||||||
|
lineHeightMode: Text.ProportionalHeight
|
||||||
|
horizontalAlignment: Text.AlignHCenter
|
||||||
|
}
|
||||||
|
|
||||||
|
Row {
|
||||||
|
id: buttons
|
||||||
|
anchors {
|
||||||
|
top: mainTextContainer.bottom
|
||||||
|
horizontalCenter: parent.horizontalCenter
|
||||||
|
margins: 0
|
||||||
|
topMargin: 2 * hifi.dimensions.contentSpacing.y
|
||||||
|
}
|
||||||
|
spacing: hifi.dimensions.contentSpacing.x
|
||||||
|
onHeightChanged: d.resize(); onWidthChanged: d.resize();
|
||||||
|
|
||||||
|
Button {
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
|
||||||
|
width: undefined // invalidate so that the image's size sets the width
|
||||||
|
height: undefined // invalidate so that the image's size sets the height
|
||||||
|
focus: true
|
||||||
|
|
||||||
|
style: OriginalStyles.ButtonStyle {
|
||||||
|
background: Image {
|
||||||
|
id: buttonImage
|
||||||
|
source: "../../images/steam-sign-in.png"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
onClicked: signInBody.login()
|
||||||
|
}
|
||||||
|
Button {
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
|
||||||
|
text: qsTr("Cancel");
|
||||||
|
|
||||||
|
onClicked: signInBody.cancel()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
root.title = required ? qsTr("Sign In Required")
|
||||||
|
: qsTr("Sign In")
|
||||||
|
root.iconText = ""
|
||||||
|
d.resize();
|
||||||
|
}
|
||||||
|
}
|
162
interface/resources/qml/LoginDialog/UsernameCollisionBody.qml
Normal file
162
interface/resources/qml/LoginDialog/UsernameCollisionBody.qml
Normal file
|
@ -0,0 +1,162 @@
|
||||||
|
//
|
||||||
|
// UsernameCollisionBody.qml
|
||||||
|
//
|
||||||
|
// Created by Clement on 7/18/16
|
||||||
|
// Copyright 2015 High Fidelity, Inc.
|
||||||
|
//
|
||||||
|
// Distributed under the Apache License, Version 2.0.
|
||||||
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
|
//
|
||||||
|
|
||||||
|
import Hifi 1.0
|
||||||
|
import QtQuick 2.4
|
||||||
|
import QtQuick.Controls 1.4
|
||||||
|
import QtQuick.Controls.Styles 1.4 as OriginalStyles
|
||||||
|
|
||||||
|
import "../controls-uit"
|
||||||
|
import "../styles-uit"
|
||||||
|
|
||||||
|
Item {
|
||||||
|
id: usernameCollisionBody
|
||||||
|
clip: true
|
||||||
|
width: pane.width
|
||||||
|
height: pane.height
|
||||||
|
|
||||||
|
QtObject {
|
||||||
|
id: d
|
||||||
|
readonly property int minWidth: 480
|
||||||
|
readonly property int maxWidth: 1280
|
||||||
|
readonly property int minHeight: 120
|
||||||
|
readonly property int maxHeight: 720
|
||||||
|
|
||||||
|
function resize() {
|
||||||
|
var targetWidth = Math.max(titleWidth, mainTextContainer.visible ? mainTextContainer.contentWidth : 0)
|
||||||
|
var targetHeight = (mainTextContainer.visible ? mainTextContainer.height : 0) +
|
||||||
|
4 * hifi.dimensions.contentSpacing.y + form.height +
|
||||||
|
4 * hifi.dimensions.contentSpacing.y + buttons.height
|
||||||
|
|
||||||
|
root.width = Math.max(d.minWidth, Math.min(d.maxWidth, targetWidth))
|
||||||
|
root.height = Math.max(d.minHeight, Math.min(d.maxHeight, targetHeight))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
MenuItem {
|
||||||
|
id: mainTextContainer
|
||||||
|
anchors {
|
||||||
|
top: parent.top
|
||||||
|
horizontalCenter: parent.horizontalCenter
|
||||||
|
margins: 0
|
||||||
|
topMargin: hifi.dimensions.contentSpacing.y
|
||||||
|
}
|
||||||
|
|
||||||
|
text: qsTr("Choose your High Fidelity user name:")
|
||||||
|
wrapMode: Text.WordWrap
|
||||||
|
color: hifi.colors.baseGrayHighlight
|
||||||
|
lineHeight: 1
|
||||||
|
lineHeightMode: Text.ProportionalHeight
|
||||||
|
horizontalAlignment: Text.AlignHCenter
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Column {
|
||||||
|
id: form
|
||||||
|
anchors {
|
||||||
|
top: mainTextContainer.bottom
|
||||||
|
left: parent.left
|
||||||
|
margins: 0
|
||||||
|
topMargin: 2 * hifi.dimensions.contentSpacing.y
|
||||||
|
}
|
||||||
|
spacing: 2 * hifi.dimensions.contentSpacing.y
|
||||||
|
|
||||||
|
Row {
|
||||||
|
spacing: hifi.dimensions.contentSpacing.x
|
||||||
|
|
||||||
|
TextField {
|
||||||
|
id: usernameField
|
||||||
|
anchors {
|
||||||
|
verticalCenter: parent.verticalCenter
|
||||||
|
}
|
||||||
|
width: 350
|
||||||
|
|
||||||
|
label: "User Name or Email"
|
||||||
|
}
|
||||||
|
|
||||||
|
ShortcutText {
|
||||||
|
anchors {
|
||||||
|
verticalCenter: parent.verticalCenter
|
||||||
|
}
|
||||||
|
|
||||||
|
text: "Need help?"
|
||||||
|
|
||||||
|
color: hifi.colors.blueAccent
|
||||||
|
font.underline: true
|
||||||
|
|
||||||
|
verticalAlignment: Text.AlignVCenter
|
||||||
|
horizontalAlignment: Text.AlignHCenter
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Row {
|
||||||
|
spacing: hifi.dimensions.contentSpacing.x
|
||||||
|
|
||||||
|
TextField {
|
||||||
|
id: passwordField
|
||||||
|
anchors {
|
||||||
|
verticalCenter: parent.verticalCenter
|
||||||
|
}
|
||||||
|
width: 350
|
||||||
|
|
||||||
|
label: "Password"
|
||||||
|
echoMode: TextInput.Password
|
||||||
|
}
|
||||||
|
|
||||||
|
ShortcutText {
|
||||||
|
anchors {
|
||||||
|
verticalCenter: parent.verticalCenter
|
||||||
|
}
|
||||||
|
|
||||||
|
text: "Need help?"
|
||||||
|
|
||||||
|
color: hifi.colors.blueAccent
|
||||||
|
font.underline: true
|
||||||
|
|
||||||
|
verticalAlignment: Text.AlignVCenter
|
||||||
|
horizontalAlignment: Text.AlignHCenter
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
Row {
|
||||||
|
id: buttons
|
||||||
|
anchors {
|
||||||
|
top: form.bottom
|
||||||
|
right: parent.right
|
||||||
|
margins: 0
|
||||||
|
topMargin: 3 * hifi.dimensions.contentSpacing.y
|
||||||
|
}
|
||||||
|
spacing: hifi.dimensions.contentSpacing.x
|
||||||
|
onHeightChanged: d.resize(); onWidthChanged: d.resize();
|
||||||
|
|
||||||
|
Button {
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
width: 200
|
||||||
|
|
||||||
|
text: qsTr("Create your profile")
|
||||||
|
color: hifi.buttons.blue
|
||||||
|
}
|
||||||
|
|
||||||
|
Button {
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
|
||||||
|
text: qsTr("Cancel")
|
||||||
|
|
||||||
|
onClicked: root.destroy()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
root.title = qsTr("Complete Your Profile")
|
||||||
|
root.iconText = "<"
|
||||||
|
d.resize();
|
||||||
|
}
|
||||||
|
}
|
83
interface/resources/qml/LoginDialog/WelcomeBody.qml
Normal file
83
interface/resources/qml/LoginDialog/WelcomeBody.qml
Normal file
|
@ -0,0 +1,83 @@
|
||||||
|
//
|
||||||
|
// WelcomeBody.qml
|
||||||
|
//
|
||||||
|
// Created by Clement on 7/18/16
|
||||||
|
// Copyright 2015 High Fidelity, Inc.
|
||||||
|
//
|
||||||
|
// Distributed under the Apache License, Version 2.0.
|
||||||
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
|
//
|
||||||
|
|
||||||
|
import Hifi 1.0
|
||||||
|
import QtQuick 2.4
|
||||||
|
|
||||||
|
import "../controls-uit"
|
||||||
|
import "../styles-uit"
|
||||||
|
|
||||||
|
Item {
|
||||||
|
id: welcomeBody
|
||||||
|
clip: true
|
||||||
|
width: pane.width
|
||||||
|
height: pane.height
|
||||||
|
|
||||||
|
property bool welcomeBack: true
|
||||||
|
|
||||||
|
QtObject {
|
||||||
|
id: d
|
||||||
|
readonly property int minWidth: 480
|
||||||
|
readonly property int maxWidth: 1280
|
||||||
|
readonly property int minHeight: 120
|
||||||
|
readonly property int maxHeight: 720
|
||||||
|
|
||||||
|
function resize() {
|
||||||
|
var targetWidth = Math.max(titleWidth, mainTextContainer.contentWidth)
|
||||||
|
var targetHeight = mainTextContainer.height + 3 * hifi.dimensions.contentSpacing.y + buttons.height
|
||||||
|
|
||||||
|
root.width = Math.max(d.minWidth, Math.min(d.maxWidth, targetWidth))
|
||||||
|
root.height = Math.max(d.minHeight, Math.min(d.maxHeight, targetHeight))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
MenuItem {
|
||||||
|
id: mainTextContainer
|
||||||
|
anchors {
|
||||||
|
top: parent.top
|
||||||
|
horizontalCenter: parent.horizontalCenter
|
||||||
|
margins: 0
|
||||||
|
topMargin: hifi.dimensions.contentSpacing.y
|
||||||
|
}
|
||||||
|
|
||||||
|
text: qsTr("You are now signed into High Fidelity")
|
||||||
|
wrapMode: Text.WordWrap
|
||||||
|
color: hifi.colors.baseGrayHighlight
|
||||||
|
lineHeight: 2
|
||||||
|
lineHeightMode: Text.ProportionalHeight
|
||||||
|
horizontalAlignment: Text.AlignHCenter
|
||||||
|
}
|
||||||
|
|
||||||
|
Row {
|
||||||
|
id: buttons
|
||||||
|
anchors {
|
||||||
|
top: mainTextContainer.bottom
|
||||||
|
horizontalCenter: parent.horizontalCenter
|
||||||
|
margins: 0
|
||||||
|
topMargin: 2 * hifi.dimensions.contentSpacing.y
|
||||||
|
}
|
||||||
|
spacing: hifi.dimensions.contentSpacing.x
|
||||||
|
onHeightChanged: d.resize(); onWidthChanged: d.resize();
|
||||||
|
|
||||||
|
Button {
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
|
||||||
|
text: qsTr("Close");
|
||||||
|
|
||||||
|
onClicked: root.destroy()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
root.title = (welcomeBack ? qsTr("Welcome back <b>") : qsTr("Welcome <b>")) + Account.getUsername() + qsTr("</b>!")
|
||||||
|
root.iconText = ""
|
||||||
|
d.resize();
|
||||||
|
}
|
||||||
|
}
|
197
interface/resources/qml/LoginDialogSave.qml
Normal file
197
interface/resources/qml/LoginDialogSave.qml
Normal file
|
@ -0,0 +1,197 @@
|
||||||
|
Window {
|
||||||
|
id: root
|
||||||
|
HifiConstants { id: hifi }
|
||||||
|
|
||||||
|
width: 550
|
||||||
|
height: 200
|
||||||
|
|
||||||
|
anchors.centerIn: parent
|
||||||
|
resizable: true
|
||||||
|
|
||||||
|
property bool required: false
|
||||||
|
|
||||||
|
Component {
|
||||||
|
id: welcomeBody
|
||||||
|
|
||||||
|
Column {
|
||||||
|
anchors.centerIn: parent
|
||||||
|
|
||||||
|
OverlayTitle {
|
||||||
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
|
||||||
|
text: "Welcomeback Atlante45!"
|
||||||
|
color: hifi.colors.baseGrayHighlight
|
||||||
|
verticalAlignment: Text.AlignVCenter
|
||||||
|
horizontalAlignment: Text.AlignHCenter
|
||||||
|
}
|
||||||
|
|
||||||
|
VerticalSpacer {}
|
||||||
|
|
||||||
|
HorizontalRule {}
|
||||||
|
|
||||||
|
MenuItem {
|
||||||
|
id: details
|
||||||
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
|
||||||
|
text: "You are now signed into High Fidelity"
|
||||||
|
color: hifi.colors.baseGrayHighlight
|
||||||
|
verticalAlignment: Text.AlignVCenter
|
||||||
|
horizontalAlignment: Text.AlignHCenter
|
||||||
|
}
|
||||||
|
|
||||||
|
VerticalSpacer {}
|
||||||
|
|
||||||
|
Button {
|
||||||
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
|
||||||
|
text: "Close"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Component {
|
||||||
|
id: signInBody
|
||||||
|
|
||||||
|
Column {
|
||||||
|
anchors.centerIn: parent
|
||||||
|
|
||||||
|
OverlayTitle {
|
||||||
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
|
||||||
|
text: required ? "Sign In Required" : "Sign In"
|
||||||
|
color: hifi.colors.baseGrayHighlight
|
||||||
|
verticalAlignment: Text.AlignVCenter
|
||||||
|
horizontalAlignment: Text.AlignHCenter
|
||||||
|
}
|
||||||
|
|
||||||
|
VerticalSpacer {}
|
||||||
|
|
||||||
|
HorizontalRule {}
|
||||||
|
|
||||||
|
MenuItem {
|
||||||
|
id: details
|
||||||
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
|
||||||
|
text: required ? "This domain's owner requires that you sign in:"
|
||||||
|
: "Sign in to access your user account:"
|
||||||
|
color: hifi.colors.baseGrayHighlight
|
||||||
|
verticalAlignment: Text.AlignVCenter
|
||||||
|
horizontalAlignment: Text.AlignHCenter
|
||||||
|
}
|
||||||
|
|
||||||
|
VerticalSpacer {}
|
||||||
|
|
||||||
|
Row {
|
||||||
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
|
||||||
|
Button {
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
width: undefined // invalidate so that the image's size sets the width
|
||||||
|
height: undefined // invalidate so that the image's size sets the height
|
||||||
|
|
||||||
|
style: Original.ButtonStyle {
|
||||||
|
background: Image {
|
||||||
|
id: buttonImage
|
||||||
|
source: "../images/steam-sign-in.png"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onClicked: body.sourceComponent = completeProfileBody
|
||||||
|
}
|
||||||
|
|
||||||
|
HorizontalSpacer {}
|
||||||
|
|
||||||
|
Button {
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
|
||||||
|
text: "Cancel"
|
||||||
|
|
||||||
|
onClicked: required = !required
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Component {
|
||||||
|
id: completeProfileBody
|
||||||
|
|
||||||
|
Column {
|
||||||
|
anchors.centerIn: parent
|
||||||
|
|
||||||
|
Row {
|
||||||
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
|
||||||
|
HiFiGlyphs {
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
|
||||||
|
text: hifi.glyphs.avatar
|
||||||
|
}
|
||||||
|
|
||||||
|
OverlayTitle {
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
|
||||||
|
text: "Complete Your Profile"
|
||||||
|
color: hifi.colors.baseGrayHighlight
|
||||||
|
verticalAlignment: Text.AlignVCenter
|
||||||
|
horizontalAlignment: Text.AlignHCenter
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
VerticalSpacer {}
|
||||||
|
|
||||||
|
HorizontalRule {}
|
||||||
|
|
||||||
|
VerticalSpacer {}
|
||||||
|
|
||||||
|
Row {
|
||||||
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
|
||||||
|
Button {
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
|
||||||
|
width: 200
|
||||||
|
|
||||||
|
text: "Create your profile"
|
||||||
|
color: hifi.buttons.blue
|
||||||
|
|
||||||
|
onClicked: body.sourceComponent = welcomeBody
|
||||||
|
}
|
||||||
|
|
||||||
|
HorizontalSpacer {}
|
||||||
|
|
||||||
|
Button {
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
|
||||||
|
text: "Cancel"
|
||||||
|
|
||||||
|
onClicked: body.sourceComponent = signInBody
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
VerticalSpacer {}
|
||||||
|
|
||||||
|
ShortcutText {
|
||||||
|
text: "Already have a High Fidelity profile? Link to an existing profile here."
|
||||||
|
|
||||||
|
color: hifi.colors.blueAccent
|
||||||
|
font.underline: true
|
||||||
|
|
||||||
|
verticalAlignment: Text.AlignVCenter
|
||||||
|
horizontalAlignment: Text.AlignHCenter
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
anchors.fill: root
|
||||||
|
color: hifi.colors.faintGray
|
||||||
|
radius: hifi.dimensions.borderRadius
|
||||||
|
|
||||||
|
Loader {
|
||||||
|
id: body
|
||||||
|
anchors.centerIn: parent
|
||||||
|
sourceComponent: signInBody
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
20
interface/resources/qml/controls-uit/HorizontalRule.qml
Normal file
20
interface/resources/qml/controls-uit/HorizontalRule.qml
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
//
|
||||||
|
// HorizontalRule.qml
|
||||||
|
//
|
||||||
|
// Created by Clement on 7/18/16
|
||||||
|
// Copyright 2016 High Fidelity, Inc.
|
||||||
|
//
|
||||||
|
// Distributed under the Apache License, Version 2.0.
|
||||||
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
|
//
|
||||||
|
|
||||||
|
import QtQuick 2.5
|
||||||
|
import QtQuick.Controls 1.4
|
||||||
|
import QtQuick.Controls.Styles 1.4
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.right: parent.right
|
||||||
|
height: 1
|
||||||
|
color: hifi.colors.lightGray
|
||||||
|
}
|
21
interface/resources/qml/controls-uit/HorizontalSpacer.qml
Normal file
21
interface/resources/qml/controls-uit/HorizontalSpacer.qml
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
//
|
||||||
|
// HorizontalSpacer.qml
|
||||||
|
//
|
||||||
|
// Created by Clement on 7/18/16
|
||||||
|
// Copyright 2016 High Fidelity, Inc.
|
||||||
|
//
|
||||||
|
// Distributed under the Apache License, Version 2.0.
|
||||||
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
|
//
|
||||||
|
|
||||||
|
import QtQuick 2.5
|
||||||
|
|
||||||
|
import "../styles-uit"
|
||||||
|
|
||||||
|
Item {
|
||||||
|
id: root
|
||||||
|
property alias size: root.width
|
||||||
|
|
||||||
|
width: hifi.dimensions.controlInterlineHeight
|
||||||
|
height: 1 // Must be non-zero
|
||||||
|
}
|
|
@ -13,6 +13,9 @@ import QtQuick 2.5
|
||||||
import "../styles-uit"
|
import "../styles-uit"
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
|
id: root
|
||||||
|
property alias size: root.height
|
||||||
|
|
||||||
width: 1 // Must be non-zero
|
width: 1 // Must be non-zero
|
||||||
height: hifi.dimensions.controlInterlineHeight
|
height: hifi.dimensions.controlInterlineHeight
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,8 +21,6 @@ import "messageDialog"
|
||||||
ModalWindow {
|
ModalWindow {
|
||||||
id: root
|
id: root
|
||||||
HifiConstants { id: hifi }
|
HifiConstants { id: hifi }
|
||||||
implicitWidth: 640
|
|
||||||
implicitHeight: 320
|
|
||||||
destroyOnCloseButton: true
|
destroyOnCloseButton: true
|
||||||
destroyOnHidden: true
|
destroyOnHidden: true
|
||||||
visible: true
|
visible: true
|
||||||
|
@ -70,7 +68,7 @@ ModalWindow {
|
||||||
QtObject {
|
QtObject {
|
||||||
id: d
|
id: d
|
||||||
readonly property int minWidth: 480
|
readonly property int minWidth: 480
|
||||||
readonly property int maxWdith: 1280
|
readonly property int maxWidth: 1280
|
||||||
readonly property int minHeight: 120
|
readonly property int minHeight: 120
|
||||||
readonly property int maxHeight: 720
|
readonly property int maxHeight: 720
|
||||||
|
|
||||||
|
@ -80,7 +78,7 @@ ModalWindow {
|
||||||
+ (informativeTextContainer.text != "" ? informativeTextContainer.contentHeight + 3 * hifi.dimensions.contentSpacing.y : 0)
|
+ (informativeTextContainer.text != "" ? informativeTextContainer.contentHeight + 3 * hifi.dimensions.contentSpacing.y : 0)
|
||||||
+ buttons.height
|
+ buttons.height
|
||||||
+ (content.state === "expanded" ? details.implicitHeight + hifi.dimensions.contentSpacing.y : 0)
|
+ (content.state === "expanded" ? details.implicitHeight + hifi.dimensions.contentSpacing.y : 0)
|
||||||
root.width = (targetWidth < d.minWidth) ? d.minWidth : ((targetWidth > d.maxWdith) ? d.maxWidth : targetWidth)
|
root.width = (targetWidth < d.minWidth) ? d.minWidth : ((targetWidth > d.maxWidth) ? d.maxWidth : targetWidth)
|
||||||
root.height = (targetHeight < d.minHeight) ? d.minHeight: ((targetHeight > d.maxHeight) ? d.maxHeight : targetHeight)
|
root.height = (targetHeight < d.minHeight) ? d.minHeight: ((targetHeight > d.maxHeight) ? d.maxHeight : targetHeight)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
18
interface/resources/qml/styles-uit/ButtonLabel.qml
Normal file
18
interface/resources/qml/styles-uit/ButtonLabel.qml
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
//
|
||||||
|
// ButtonLabel.qml
|
||||||
|
//
|
||||||
|
// Created by Clement on 7/18/16
|
||||||
|
// Copyright 2016 High Fidelity, Inc.
|
||||||
|
//
|
||||||
|
// Distributed under the Apache License, Version 2.0.
|
||||||
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
|
//
|
||||||
|
|
||||||
|
import QtQuick 2.5
|
||||||
|
import QtQuick.Controls 1.4
|
||||||
|
import QtQuick.Controls.Styles 1.4
|
||||||
|
import "."
|
||||||
|
|
||||||
|
RalewayBold {
|
||||||
|
font.pixelSize: hifi.fontSizes.buttonLabel
|
||||||
|
}
|
20
interface/resources/qml/styles-uit/IconButton.qml
Normal file
20
interface/resources/qml/styles-uit/IconButton.qml
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
//
|
||||||
|
// IconButton.qml
|
||||||
|
//
|
||||||
|
// Created by Clement on 7/18/16
|
||||||
|
// Copyright 2016 High Fidelity, Inc.
|
||||||
|
//
|
||||||
|
// Distributed under the Apache License, Version 2.0.
|
||||||
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
|
//
|
||||||
|
|
||||||
|
import QtQuick 2.5
|
||||||
|
import QtQuick.Controls 1.4
|
||||||
|
import QtQuick.Controls.Styles 1.4
|
||||||
|
import "."
|
||||||
|
|
||||||
|
RalewayRegular {
|
||||||
|
font.pixelSize: hifi.fontSizes.iconButton
|
||||||
|
font.capitalization: Font.AllUppercase
|
||||||
|
font.letterSpacing: 1.5
|
||||||
|
}
|
18
interface/resources/qml/styles-uit/InputLabel.qml
Normal file
18
interface/resources/qml/styles-uit/InputLabel.qml
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
//
|
||||||
|
// InputLabel.qml
|
||||||
|
//
|
||||||
|
// Created by Clement on 7/18/16
|
||||||
|
// Copyright 2016 High Fidelity, Inc.
|
||||||
|
//
|
||||||
|
// Distributed under the Apache License, Version 2.0.
|
||||||
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
|
//
|
||||||
|
|
||||||
|
import QtQuick 2.5
|
||||||
|
import QtQuick.Controls 1.4
|
||||||
|
import QtQuick.Controls.Styles 1.4
|
||||||
|
import "."
|
||||||
|
|
||||||
|
RalewaySemiBold {
|
||||||
|
font.pixelSize: hifi.fontSizes.inputLabel
|
||||||
|
}
|
18
interface/resources/qml/styles-uit/ListItem.qml
Normal file
18
interface/resources/qml/styles-uit/ListItem.qml
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
//
|
||||||
|
// ListItem.qml
|
||||||
|
//
|
||||||
|
// Created by Clement on 7/18/16
|
||||||
|
// Copyright 2016 High Fidelity, Inc.
|
||||||
|
//
|
||||||
|
// Distributed under the Apache License, Version 2.0.
|
||||||
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
|
//
|
||||||
|
|
||||||
|
import QtQuick 2.5
|
||||||
|
import QtQuick.Controls 1.4
|
||||||
|
import QtQuick.Controls.Styles 1.4
|
||||||
|
import "."
|
||||||
|
|
||||||
|
RalewayRegular {
|
||||||
|
font.pixelSize: hifi.fontSizes.listItem
|
||||||
|
}
|
18
interface/resources/qml/styles-uit/Logs.qml
Normal file
18
interface/resources/qml/styles-uit/Logs.qml
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
//
|
||||||
|
// Logs.qml
|
||||||
|
//
|
||||||
|
// Created by Clement on 7/18/16
|
||||||
|
// Copyright 2016 High Fidelity, Inc.
|
||||||
|
//
|
||||||
|
// Distributed under the Apache License, Version 2.0.
|
||||||
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
|
//
|
||||||
|
|
||||||
|
import QtQuick 2.5
|
||||||
|
import QtQuick.Controls 1.4
|
||||||
|
import QtQuick.Controls.Styles 1.4
|
||||||
|
import "."
|
||||||
|
|
||||||
|
AnonymousProRegular {
|
||||||
|
font.pixelSize: hifi.fontSizes.logs
|
||||||
|
}
|
19
interface/resources/qml/styles-uit/MenuItem.qml
Normal file
19
interface/resources/qml/styles-uit/MenuItem.qml
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
//
|
||||||
|
// MenuItem.qml
|
||||||
|
//
|
||||||
|
// Created by Clement on 7/18/16
|
||||||
|
// Copyright 2016 High Fidelity, Inc.
|
||||||
|
//
|
||||||
|
// Distributed under the Apache License, Version 2.0.
|
||||||
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
|
//
|
||||||
|
|
||||||
|
import QtQuick 2.5
|
||||||
|
import QtQuick.Controls 1.4
|
||||||
|
import QtQuick.Controls.Styles 1.4
|
||||||
|
import "."
|
||||||
|
|
||||||
|
RalewaySemiBold {
|
||||||
|
lineHeight: 2
|
||||||
|
font.pixelSize: hifi.fontSizes.menuItem
|
||||||
|
}
|
18
interface/resources/qml/styles-uit/OverlayTitle.qml
Normal file
18
interface/resources/qml/styles-uit/OverlayTitle.qml
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
//
|
||||||
|
// OverlayTitle.qml
|
||||||
|
//
|
||||||
|
// Created by Clement on 7/18/16
|
||||||
|
// Copyright 2016 High Fidelity, Inc.
|
||||||
|
//
|
||||||
|
// Distributed under the Apache License, Version 2.0.
|
||||||
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
|
//
|
||||||
|
|
||||||
|
import QtQuick 2.5
|
||||||
|
import QtQuick.Controls 1.4
|
||||||
|
import QtQuick.Controls.Styles 1.4
|
||||||
|
import "."
|
||||||
|
|
||||||
|
RalewayRegular {
|
||||||
|
font.pixelSize: hifi.fontSizes.overlayTitle
|
||||||
|
}
|
19
interface/resources/qml/styles-uit/SectionName.qml
Normal file
19
interface/resources/qml/styles-uit/SectionName.qml
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
//
|
||||||
|
// SectionName.qml
|
||||||
|
//
|
||||||
|
// Created by Clement on 7/18/16
|
||||||
|
// Copyright 2016 High Fidelity, Inc.
|
||||||
|
//
|
||||||
|
// Distributed under the Apache License, Version 2.0.
|
||||||
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
|
//
|
||||||
|
|
||||||
|
import QtQuick 2.5
|
||||||
|
import QtQuick.Controls 1.4
|
||||||
|
import QtQuick.Controls.Styles 1.4
|
||||||
|
import "."
|
||||||
|
|
||||||
|
RalewayRegular {
|
||||||
|
font.pixelSize: hifi.fontSizes.sectionName
|
||||||
|
font.capitalization: Font.AllUppercase
|
||||||
|
}
|
18
interface/resources/qml/styles-uit/ShortcutText.qml
Normal file
18
interface/resources/qml/styles-uit/ShortcutText.qml
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
//
|
||||||
|
// ShortcutText.qml
|
||||||
|
//
|
||||||
|
// Created by Clement on 7/18/16
|
||||||
|
// Copyright 2016 High Fidelity, Inc.
|
||||||
|
//
|
||||||
|
// Distributed under the Apache License, Version 2.0.
|
||||||
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
|
//
|
||||||
|
|
||||||
|
import QtQuick 2.5
|
||||||
|
import QtQuick.Controls 1.4
|
||||||
|
import QtQuick.Controls.Styles 1.4
|
||||||
|
import "."
|
||||||
|
|
||||||
|
RalewayLight {
|
||||||
|
font.pixelSize: hifi.fontSizes.shortcutText
|
||||||
|
}
|
19
interface/resources/qml/styles-uit/TabName.qml
Normal file
19
interface/resources/qml/styles-uit/TabName.qml
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
//
|
||||||
|
// TabName.qml
|
||||||
|
//
|
||||||
|
// Created by Clement on 7/18/16
|
||||||
|
// Copyright 2016 High Fidelity, Inc.
|
||||||
|
//
|
||||||
|
// Distributed under the Apache License, Version 2.0.
|
||||||
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
|
//
|
||||||
|
|
||||||
|
import QtQuick 2.5
|
||||||
|
import QtQuick.Controls 1.4
|
||||||
|
import QtQuick.Controls.Styles 1.4
|
||||||
|
import "."
|
||||||
|
|
||||||
|
RalewayRegular {
|
||||||
|
font.pixelSize: hifi.fontSizes.tabName
|
||||||
|
font.capitalization: Font.AllUppercase
|
||||||
|
}
|
18
interface/resources/qml/styles-uit/TextFieldInput.qml
Normal file
18
interface/resources/qml/styles-uit/TextFieldInput.qml
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
//
|
||||||
|
// TextFieldInput.qml
|
||||||
|
//
|
||||||
|
// Created by Clement on 7/18/16
|
||||||
|
// Copyright 2016 High Fidelity, Inc.
|
||||||
|
//
|
||||||
|
// Distributed under the Apache License, Version 2.0.
|
||||||
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
|
//
|
||||||
|
|
||||||
|
import QtQuick 2.5
|
||||||
|
import QtQuick.Controls 1.4
|
||||||
|
import QtQuick.Controls.Styles 1.4
|
||||||
|
import "."
|
||||||
|
|
||||||
|
FiraSansSemiBold {
|
||||||
|
font.pixelSize: hifi.fontSizes.textFieldInput
|
||||||
|
}
|
|
@ -2242,11 +2242,12 @@ void Application::keyPressEvent(QKeyEvent* event) {
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Qt::Key_X:
|
case Qt::Key_X:
|
||||||
if (isShifted && isMeta) {
|
if (isMeta) {
|
||||||
auto offscreenUi = DependencyManager::get<OffscreenUi>();
|
auto offscreenUi = DependencyManager::get<OffscreenUi>();
|
||||||
offscreenUi->togglePinned();
|
// offscreenUi->togglePinned();
|
||||||
//offscreenUi->getRootContext()->engine()->clearComponentCache();
|
offscreenUi->getRootContext()->engine()->clearComponentCache();
|
||||||
//OffscreenUi::information("Debugging", "Component cache cleared");
|
qDebug() << "Component cache cleared";
|
||||||
|
// OffscreenUi::information("Debugging", "Component cache cleared");
|
||||||
// placeholder for dialogs being converted to QML.
|
// placeholder for dialogs being converted to QML.
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -22,9 +22,7 @@
|
||||||
|
|
||||||
HIFI_QML_DEF(LoginDialog)
|
HIFI_QML_DEF(LoginDialog)
|
||||||
|
|
||||||
LoginDialog::LoginDialog(QQuickItem *parent) : OffscreenQmlDialog(parent),
|
LoginDialog::LoginDialog(QQuickItem *parent) : OffscreenQmlDialog(parent) {
|
||||||
_rootUrl(NetworkingConstants::METAVERSE_SERVER_URL.toString())
|
|
||||||
{
|
|
||||||
auto accountManager = DependencyManager::get<AccountManager>();
|
auto accountManager = DependencyManager::get<AccountManager>();
|
||||||
connect(accountManager.data(), &AccountManager::loginComplete,
|
connect(accountManager.data(), &AccountManager::loginComplete,
|
||||||
this, &LoginDialog::handleLoginCompleted);
|
this, &LoginDialog::handleLoginCompleted);
|
||||||
|
@ -54,42 +52,16 @@ void LoginDialog::toggleAction() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LoginDialog::handleLoginCompleted(const QUrl&) {
|
|
||||||
hide();
|
|
||||||
}
|
|
||||||
|
|
||||||
void LoginDialog::handleLoginFailed() {
|
|
||||||
setStatusText("Invalid username or password");
|
|
||||||
}
|
|
||||||
|
|
||||||
void LoginDialog::setStatusText(const QString& statusText) {
|
|
||||||
if (statusText != _statusText) {
|
|
||||||
_statusText = statusText;
|
|
||||||
emit statusTextChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
QString LoginDialog::statusText() const {
|
|
||||||
return _statusText;
|
|
||||||
}
|
|
||||||
|
|
||||||
QString LoginDialog::rootUrl() const {
|
|
||||||
return _rootUrl;
|
|
||||||
}
|
|
||||||
|
|
||||||
void LoginDialog::login(const QString& username, const QString& password) {
|
void LoginDialog::login(const QString& username, const QString& password) {
|
||||||
qDebug() << "Attempting to login " << username;
|
qDebug() << "Attempting to login " << username;
|
||||||
setStatusText("Logging in...");
|
|
||||||
DependencyManager::get<AccountManager>()->requestAccessToken(username, password);
|
DependencyManager::get<AccountManager>()->requestAccessToken(username, password);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LoginDialog::loginThroughSteam() {
|
void LoginDialog::loginThroughSteam() {
|
||||||
qDebug() << "Attempting to login through Steam";
|
qDebug() << "Attempting to login through Steam";
|
||||||
setStatusText("Logging in...");
|
|
||||||
|
|
||||||
SteamClient::requestTicket([this](Ticket ticket) {
|
SteamClient::requestTicket([this](Ticket ticket) {
|
||||||
if (ticket.isNull()) {
|
if (ticket.isNull()) {
|
||||||
setStatusText("Steam client not logged into an account");
|
emit handleLoginFailed();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -98,6 +70,5 @@ void LoginDialog::loginThroughSteam() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void LoginDialog::openUrl(const QString& url) {
|
void LoginDialog::openUrl(const QString& url) {
|
||||||
qDebug() << url;
|
|
||||||
QDesktopServices::openUrl(url);
|
QDesktopServices::openUrl(url);
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,32 +20,19 @@ class LoginDialog : public OffscreenQmlDialog {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
HIFI_QML_DECL
|
HIFI_QML_DECL
|
||||||
|
|
||||||
Q_PROPERTY(QString statusText READ statusText WRITE setStatusText NOTIFY statusTextChanged)
|
|
||||||
Q_PROPERTY(QString rootUrl READ rootUrl)
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static void toggleAction();
|
static void toggleAction();
|
||||||
|
|
||||||
LoginDialog(QQuickItem* parent = nullptr);
|
LoginDialog(QQuickItem* parent = nullptr);
|
||||||
|
|
||||||
void setStatusText(const QString& statusText);
|
|
||||||
QString statusText() const;
|
|
||||||
|
|
||||||
QString rootUrl() const;
|
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void statusTextChanged();
|
void handleLoginCompleted();
|
||||||
|
|
||||||
protected:
|
|
||||||
void handleLoginCompleted(const QUrl& authURL);
|
|
||||||
void handleLoginFailed();
|
void handleLoginFailed();
|
||||||
|
|
||||||
|
protected:
|
||||||
Q_INVOKABLE void login(const QString& username, const QString& password);
|
Q_INVOKABLE void login(const QString& username, const QString& password);
|
||||||
Q_INVOKABLE void loginThroughSteam();
|
Q_INVOKABLE void loginThroughSteam();
|
||||||
Q_INVOKABLE void openUrl(const QString& url);
|
Q_INVOKABLE void openUrl(const QString& url);
|
||||||
private:
|
|
||||||
QString _statusText;
|
|
||||||
const QString _rootUrl;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // hifi_LoginDialog_h
|
#endif // hifi_LoginDialog_h
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
#include <QtCore/QUrl>
|
#include <QtCore/QUrl>
|
||||||
|
|
||||||
namespace NetworkingConstants {
|
namespace NetworkingConstants {
|
||||||
const QUrl METAVERSE_SERVER_URL = QUrl("https://metaverse.highfidelity.com");
|
const QUrl METAVERSE_SERVER_URL = QUrl("http://localhost:3000");
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // hifi_NetworkingConstants_h
|
#endif // hifi_NetworkingConstants_h
|
||||||
|
|
Loading…
Reference in a new issue