mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 19:04:32 +02:00
New login dialog background with circular and rectangular variations
Developer menu item toggles between the two.
This commit is contained in:
parent
d33a249b3e
commit
afc2f374e5
11 changed files with 219 additions and 173 deletions
3
interface/resources/images/login-circle.svg
Normal file
3
interface/resources/images/login-circle.svg
Normal file
|
@ -0,0 +1,3 @@
|
|||
<?xml version="1.0"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xl="http://www.w3.org/1999/xlink" version="1.1" viewBox="367 137 597 597" width="597pt" height="597pt"><metadata xmlns:dc="http://purl.org/dc/elements/1.1/"><dc:date>2015-06-02 19:43Z</dc:date><!-- Produced by OmniGraffle Professional 5.4.4 --></metadata><defs></defs><g stroke="none" stroke-opacity="1" stroke-dasharray="none" fill="none" fill-opacity="1"><title>Canvas 1</title><g><title>Login Circle</title><path d="M 876.3199 224.28243 C 992.69666 340.65858 992.69666 529.34146 876.3199 645.7176 C 759.94376 762.09436 571.2609 762.09436 454.88474 645.7176 C 338.508 529.34146 338.508 340.65858 454.88474 224.28243 C 571.2609 107.905684 759.94376 107.905684 876.3199 224.28243" fill="#2c86b1" fill-opacity=".85"/></g></g></svg>
|
After Width: | Height: | Size: 898 B |
55
interface/resources/images/login-close.svg
Normal file
55
interface/resources/images/login-close.svg
Normal file
|
@ -0,0 +1,55 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
version="1.1"
|
||||
id="pomodoro"
|
||||
x="0px"
|
||||
y="0px"
|
||||
width="100"
|
||||
height="100"
|
||||
viewBox="-7.125 -7.328 100 100"
|
||||
enable-background="new -7.125 -7.328 100 91.57"
|
||||
xml:space="preserve"
|
||||
inkscape:version="0.91 r13725"
|
||||
sodipodi:docname="login-close.svg"><metadata
|
||||
id="metadata4143"><rdf:RDF><cc:Work
|
||||
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title /></cc:Work></rdf:RDF></metadata><defs
|
||||
id="defs4141" /><sodipodi:namedview
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1"
|
||||
objecttolerance="10"
|
||||
gridtolerance="10"
|
||||
guidetolerance="10"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-width="1835"
|
||||
inkscape:window-height="1057"
|
||||
id="namedview4139"
|
||||
showgrid="false"
|
||||
inkscape:zoom="4.8487496"
|
||||
inkscape:cx="-11.452085"
|
||||
inkscape:cy="37.53545"
|
||||
inkscape:window-x="77"
|
||||
inkscape:window-y="-8"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="pomodoro" /><path
|
||||
d="m 42.8705,-2.3280001 c -24.8688,0 -44.9955,20.1618001 -44.9955,45.0045001 0,24.8733 20.1267,44.9955 44.9955,44.9955 24.8427,0 45.0045,-20.1222 45.0045,-44.9955 0,-24.8427 -20.1618,-45.0045001 -45.0045,-45.0045001 z M 67.1066,57.126 57.329,66.9036 42.6293,52.221 27.9422,66.9036 18.1511,57.126 32.8247,42.4443 18.1511,27.7482 27.9422,17.9796 42.6284,32.6487 57.3281,17.9796 67.1057,27.7482 52.424,42.4434 67.1066,57.126 Z"
|
||||
id="path4137"
|
||||
inkscape:connector-curvature="0" /><path
|
||||
style="fill:#787878;fill-opacity:1;stroke:none;stroke-opacity:1"
|
||||
d="M 38.400102,87.62655 C 28.705316,86.39839 21.084707,83.18102 13.982682,77.31765 5.5185024,70.329714 -0.09877759,60.244376 -1.7904936,48.998291 -2.1921426,46.328239 -2.2434696,39.677941 -1.8825126,37.07572 0.23131941,21.836625 9.4778634,8.9272213 23.005945,2.3281243 c 9.805646,-4.783264 20.444414,-5.902737 30.964952,-3.25830896 7.357662,1.849413 14.403738,5.75570696 19.976698,11.07495366 7.36697,7.031569 12.03213,16.084669 13.58981,26.37208 0.45133,2.980701 0.44981,9.518147 -0.003,12.481442 -0.72914,4.772737 -2.08456,9.199896 -4.04575,13.214497 -2.40852,4.930297 -4.94684,8.502038 -8.75077,12.313422 -6.78153,6.79482 -14.822805,10.95587 -24.504932,12.68035 -1.787127,0.3183 -3.134188,0.40875 -6.708441,0.45045 -2.459762,0.0287 -4.765789,0.0149 -5.124505,-0.0304 z m -3.02899,-27.869116 7.314939,-7.311007 7.360877,7.35692 7.360872,7.356917 4.983865,-4.982378 4.98386,-4.982378 -7.359111,-7.358686 -7.359105,-7.358687 7.359105,-7.358687 7.359111,-7.358686 -4.98387,-4.982383 -4.983864,-4.982384 -7.407456,7.393329 -7.407456,7.393328 -7.360652,-7.342464 -7.36065,-7.342467 -4.922357,4.916384 -4.922356,4.916381 7.300528,7.417269 7.300528,7.417267 -7.362706,7.362244 -7.362709,7.362244 4.890918,4.889465 c 2.690008,2.689205 4.974582,4.889463 5.076835,4.889463 0.102254,0 3.477639,-3.289951 7.500854,-7.311004 z"
|
||||
id="path4145"
|
||||
inkscape:connector-curvature="0" /><path
|
||||
style="fill:#a5d8e3;fill-opacity:0.87843138;stroke:none;stroke-linejoin:round;stroke-opacity:1"
|
||||
d="M 44.534673,94.743449 C 34.891509,93.246309 27.795933,90.11327 20.775164,84.252477 11.886441,76.832357 5.9619527,65.158789 5.1748775,53.513789 c -0.2319637,-3.43197 -0.2319637,-3.580148 0,-7.012117 0.2997941,-4.43554 1.6142349,-10.018379 3.2047936,-13.611757 0.9426814,-2.1297 3.0434359,-6.187162 3.2034079,-6.187162 0.0878,0 0.159635,-0.08223 0.159635,-0.182738 0,-0.184553 1.62407,-2.719865 1.864629,-2.910843 0.07144,-0.05672 0.214767,-0.254527 0.318504,-0.43958 0.444428,-0.792801 4.761858,-5.745943 5.011388,-5.74928 0.06982,-9.28e-4 0.599004,-0.44177 1.175954,-0.979634 0.57695,-0.537865 1.357309,-1.209955 1.73413,-1.493533 0.376821,-0.283579 0.803015,-0.631606 0.947096,-0.773396 0.144082,-0.141789 0.33915,-0.257798 0.433485,-0.257798 0.09433,0 0.421739,-0.232019 0.727566,-0.515597 0.305826,-0.283578 0.652906,-0.515597 0.771287,-0.515597 0.118382,0 0.21524,-0.09281 0.21524,-0.206238 0,-0.113432 0.131477,-0.206239 0.292173,-0.206239 0.160693,0 0.323106,-0.06961 0.360917,-0.154679 0.03781,-0.08507 0.486379,-0.379776 0.99682,-0.654895 0.510441,-0.275119 0.974478,-0.553541 1.031194,-0.618716 0.05672,-0.06518 0.683166,-0.390786 1.392111,-0.723578 0.708946,-0.3327925 1.288992,-0.6962883 1.288992,-0.8077684 0,-0.1114801 0.0579,-0.1447959 0.128656,-0.074035 0.07076,0.070761 0.511596,-0.070816 0.979634,-0.3146147 0.468039,-0.2437989 0.943786,-0.4657735 1.057217,-0.4932771 0.232223,-0.056306 4.161879,-1.4638567 4.640372,-1.6621192 0.170147,-0.0705 0.539063,-0.1662889 0.819815,-0.2128641 0.280751,-0.046575 0.614115,-0.1707121 0.740812,-0.2758597 0.126694,-0.1051476 0.274366,-0.1471661 0.328157,-0.093375 0.05379,0.053792 0.416482,9.591e-4 0.805979,-0.1174068 0.389496,-0.1183654 0.893791,-0.250227 1.120654,-0.2930258 C 41.396501,5.8872092 42.53806,5.68664 43.297241,5.5593565 45.066132,5.2627864 46.714013,5.1673775 50,5.1712806 c 3.805191,0.00452 5.083801,0.101258 7.940191,0.6007452 1.309528,0.2289926 1.540035,0.2798038 2.254967,0.4970667 0.389497,0.1183654 0.752188,0.1711985 0.805979,0.1174068 0.05379,-0.053792 0.201463,-0.011773 0.328157,0.093375 0.126697,0.1051476 0.460061,0.2292845 0.740812,0.2758597 0.280752,0.046575 0.649668,0.1381531 0.819815,0.2035062 0.29917,0.1149109 2.471922,0.8292633 2.681104,0.8814871 0.180626,0.045095 1.113229,0.4463555 2.521561,1.0849238 0.752112,0.341023 1.420515,0.5670004 1.485344,0.502172 0.06483,-0.064829 0.11787,-0.026659 0.11787,0.084821 0,0.1114801 0.580046,0.4749759 1.288992,0.8077684 0.708945,0.332792 1.388624,0.697885 1.510393,0.811316 0.121772,0.113431 0.583276,0.391854 1.025566,0.618716 0.442289,0.226863 0.986609,0.574891 1.209598,0.773396 0.222989,0.198504 0.484793,0.360917 0.581787,0.360917 0.09699,0 0.426572,0.232019 0.732399,0.515597 0.305826,0.283578 0.626601,0.515597 0.712834,0.515597 0.08623,0 0.331378,0.162413 0.544769,0.360918 0.213391,0.198505 0.634947,0.546532 0.936792,0.773395 0.301843,0.226863 0.897759,0.737304 1.324259,1.134313 0.426497,0.39701 1.236446,1.139469 1.799884,1.64991 0.880557,0.797729 1.757212,1.75052 3.54596,3.853913 0.210933,0.248036 0.563341,0.699155 0.78313,1.002487 0.219788,0.303332 0.494773,0.657238 0.611075,0.786459 0.455109,0.505658 1.954048,2.819855 1.954048,3.016835 0,0.114715 0.07659,0.208572 0.170192,0.208572 0.161275,0 2.091162,3.737786 3.194546,6.187162 1.541607,3.422177 2.906394,9.221918 3.203098,13.611757 0.231964,3.431969 0.231964,3.580147 0,7.012117 -0.815165,12.060598 -6.997182,23.808557 -16.608839,31.562504 -6.618801,5.339542 -15.182288,8.893437 -23.343332,9.687615 -2.412178,0.234737 -8.77566,0.222144 -10.338278,-0.02046 z m 25.10828,-25.193278 5.003096,-4.999972 -7.37222,-7.374353 -7.372221,-7.374355 7.372221,-7.374354 7.37222,-7.374353 -5.053369,-5.050211 -5.053369,-5.050211 -7.48442,7.482314 -7.48442,7.482312 -7.279626,-7.328953 c -4.003795,-4.030924 -7.3403,-7.328953 -7.414457,-7.328953 -0.204703,0 -9.728156,9.56039 -9.728156,9.765886 0,0.09849 3.255479,3.479009 7.234399,7.512255 l 7.234397,7.333175 -7.389076,7.404243 -7.389078,7.404243 4.94973,4.825596 c 2.722351,2.654079 5.078575,4.828707 5.236051,4.83251 0.157477,0.0038 3.547751,-3.239037 7.53394,-7.206305 l 7.247619,-7.213218 7.31416,7.316337 c 4.022788,4.023984 7.360357,7.316336 7.416821,7.316336 0.05646,0 2.354055,-2.249986 5.105758,-4.999969 z"
|
||||
id="path4134"
|
||||
inkscape:connector-curvature="0"
|
||||
transform="translate(-7.125,-7.3280001)" /></svg>
|
After Width: | Height: | Size: 7.8 KiB |
3
interface/resources/images/login-rectangle.svg
Normal file
3
interface/resources/images/login-rectangle.svg
Normal file
|
@ -0,0 +1,3 @@
|
|||
<?xml version="1.0"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xl="http://www.w3.org/1999/xlink" version="1.1" viewBox="372 232 589 371" width="589pt" height="371pt"><metadata xmlns:dc="http://purl.org/dc/elements/1.1/"><dc:date>2015-06-02 19:42Z</dc:date><!-- Produced by OmniGraffle Professional 5.4.4 --></metadata><defs></defs><g stroke="none" stroke-opacity="1" stroke-dasharray="none" fill="none" fill-opacity="1"><title>Canvas 1</title><g><title>Login2</title><path d="M 402.21426 232.07142 L 930.78574 232.07142 C 947.3543 232.07142 960.78574 245.50288 960.78574 262.07142 L 960.78574 572.9286 C 960.78574 589.49714 947.3543 602.9286 930.78574 602.9286 L 402.21426 602.9286 C 385.64572 602.9286 372.21426 589.49714 372.21426 572.9286 L 372.21426 262.07142 C 372.21426 245.50288 385.64572 232.07142 402.21426 232.07142 Z" fill="#2c86b1" fill-opacity=".85"/></g></g></svg>
|
After Width: | Height: | Size: 983 B |
|
@ -8,7 +8,7 @@
|
|||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
//
|
||||
|
||||
import Hifi 1.0 as Hifi
|
||||
import Hifi 1.0
|
||||
import QtQuick 2.4
|
||||
import "controls"
|
||||
import "styles"
|
||||
|
@ -35,7 +35,7 @@ Dialog {
|
|||
x: parent ? parent.width / 2 - width / 2 : 0
|
||||
y: parent ? parent.height / 2 - height / 2 : 0
|
||||
|
||||
Hifi.ErrorDialog {
|
||||
ErrorDialog {
|
||||
id: content
|
||||
|
||||
implicitWidth: box.width
|
||||
|
@ -88,6 +88,7 @@ Dialog {
|
|||
}
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
cursorShape: "PointingHandCursor"
|
||||
onClicked: {
|
||||
content.accept();
|
||||
}
|
||||
|
|
|
@ -1,198 +1,119 @@
|
|||
//
|
||||
// LoginDialog.qml
|
||||
//
|
||||
// Created by David Rowe on 3 Jun 2015
|
||||
// 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.3
|
||||
import QtQuick.Controls.Styles 1.3
|
||||
import QtQuick 2.4
|
||||
import QtQuick.Controls 1.3 // TODO: Needed?
|
||||
import "controls"
|
||||
import "styles"
|
||||
|
||||
DialogOld {
|
||||
Dialog {
|
||||
id: root
|
||||
HifiConstants { id: hifi }
|
||||
title: "Login"
|
||||
|
||||
objectName: "LoginDialog"
|
||||
height: 512
|
||||
width: 384
|
||||
|
||||
onVisibleChanged: {
|
||||
if (!visible) {
|
||||
reset()
|
||||
}
|
||||
}
|
||||
property bool destroyOnInvisible: false
|
||||
|
||||
onEnabledChanged: {
|
||||
if (enabled) {
|
||||
username.forceActiveFocus();
|
||||
}
|
||||
}
|
||||
implicitWidth: loginDialog.implicitWidth
|
||||
implicitHeight: loginDialog.implicitHeight
|
||||
|
||||
function reset() {
|
||||
username.text = ""
|
||||
password.text = ""
|
||||
loginDialog.statusText = ""
|
||||
x: parent ? parent.width / 2 - width / 2 : 0
|
||||
y: parent ? parent.height / 2 - height / 2 : 0
|
||||
property int maximumX: parent ? parent.width - width : 0
|
||||
property int maximumY: parent ? parent.height - height : 0
|
||||
|
||||
function isCircular() {
|
||||
return loginDialog.dialogFormat == "circular"
|
||||
}
|
||||
|
||||
LoginDialog {
|
||||
id: loginDialog
|
||||
anchors.fill: parent
|
||||
anchors.margins: parent.margins
|
||||
anchors.topMargin: parent.topMargin
|
||||
Column {
|
||||
anchors.topMargin: 8
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: 0
|
||||
anchors.left: parent.left
|
||||
anchors.top: parent.top
|
||||
spacing: 8
|
||||
|
||||
Image {
|
||||
height: 64
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
width: 64
|
||||
source: "../images/hifi-logo.svg"
|
||||
implicitWidth: isCircular() ? circularBackground.width : rectangularBackground.width
|
||||
implicitHeight: isCircular() ? circularBackground.height : rectangularBackground.height
|
||||
|
||||
Image {
|
||||
id: circularBackground
|
||||
visible: isCircular()
|
||||
|
||||
source: "../images/login-circle.svg"
|
||||
width: 500
|
||||
height: 500
|
||||
}
|
||||
|
||||
Image {
|
||||
id: rectangularBackground
|
||||
visible: !isCircular()
|
||||
|
||||
source: "../images/login-rectangle.svg"
|
||||
width: 400
|
||||
height: 400
|
||||
}
|
||||
|
||||
Text {
|
||||
id: closeText
|
||||
visible: isCircular()
|
||||
|
||||
text: "Close"
|
||||
font.pixelSize: hifi.fonts.pixelSize * 0.8
|
||||
font.weight: Font.Bold
|
||||
color: "#175d74"
|
||||
|
||||
anchors {
|
||||
horizontalCenter: circularBackground.horizontalCenter
|
||||
bottom: circularBackground.bottom
|
||||
bottomMargin: hifi.layout.spacing * 4
|
||||
}
|
||||
|
||||
Border {
|
||||
width: 304
|
||||
height: 64
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
TextInput {
|
||||
id: username
|
||||
anchors.fill: parent
|
||||
helperText: "Username or Email"
|
||||
anchors.margins: 8
|
||||
KeyNavigation.tab: password
|
||||
KeyNavigation.backtab: password
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
cursorShape: "PointingHandCursor"
|
||||
onClicked: {
|
||||
root.enabled = false
|
||||
}
|
||||
}
|
||||
|
||||
Border {
|
||||
width: 304
|
||||
height: 64
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
TextInput {
|
||||
id: password
|
||||
anchors.fill: parent
|
||||
echoMode: TextInput.Password
|
||||
helperText: "Password"
|
||||
anchors.margins: 8
|
||||
KeyNavigation.tab: username
|
||||
KeyNavigation.backtab: username
|
||||
onFocusChanged: {
|
||||
if (password.focus) {
|
||||
password.selectAll()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Text {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
textFormat: Text.StyledText
|
||||
width: parent.width
|
||||
height: 96
|
||||
wrapMode: Text.WordWrap
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
text: loginDialog.statusText
|
||||
}
|
||||
}
|
||||
|
||||
Column {
|
||||
anchors.bottomMargin: 5
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: 0
|
||||
anchors.left: parent.left
|
||||
anchors.bottom: parent.bottom
|
||||
Image {
|
||||
id: closeIcon
|
||||
visible: !isCircular()
|
||||
|
||||
Rectangle {
|
||||
width: 192
|
||||
height: 64
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
color: hifi.colors.hifiBlue
|
||||
border.width: 0
|
||||
radius: 10
|
||||
|
||||
MouseArea {
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.bottomMargin: 0
|
||||
anchors.top: parent.top
|
||||
anchors.right: parent.right
|
||||
anchors.left: parent.left
|
||||
onClicked: {
|
||||
loginDialog.login(username.text, password.text)
|
||||
}
|
||||
}
|
||||
|
||||
Row {
|
||||
anchors.centerIn: parent
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
spacing: 8
|
||||
Image {
|
||||
id: loginIcon
|
||||
height: 32
|
||||
width: 32
|
||||
source: "../images/login.svg"
|
||||
}
|
||||
Text {
|
||||
text: "Login"
|
||||
color: "white"
|
||||
width: 64
|
||||
height: parent.height
|
||||
}
|
||||
}
|
||||
source: "../images/login-close.svg"
|
||||
|
||||
width: 20
|
||||
height: 20
|
||||
anchors {
|
||||
top: rectangularBackground.top
|
||||
right: rectangularBackground.right
|
||||
topMargin: hifi.layout.spacing * 2
|
||||
rightMargin: hifi.layout.spacing * 2
|
||||
}
|
||||
|
||||
Text {
|
||||
width: parent.width
|
||||
height: 24
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
text:"Create Account"
|
||||
font.pointSize: 12
|
||||
font.bold: true
|
||||
color: hifi.colors.hifiBlue
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: {
|
||||
loginDialog.openUrl(loginDialog.rootUrl + "/signup")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Text {
|
||||
width: parent.width
|
||||
height: 24
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
font.pointSize: 12
|
||||
text: "Recover Password"
|
||||
color: hifi.colors.hifiBlue
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: {
|
||||
loginDialog.openUrl(loginDialog.rootUrl + "/users/password/new")
|
||||
}
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
cursorShape: "PointingHandCursor"
|
||||
onClicked: {
|
||||
root.enabled = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Keys.onPressed: {
|
||||
switch(event.key) {
|
||||
case Qt.Key_Enter:
|
||||
case Qt.Key_Return:
|
||||
if (username.activeFocus) {
|
||||
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;
|
||||
switch (event.key) {
|
||||
case Qt.Key_Escape:
|
||||
case Qt.Key_Back:
|
||||
enabled = false;
|
||||
event.accepted = true
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -571,6 +571,21 @@ Menu::Menu() {
|
|||
addCheckableActionToQMenuAndActionHash(physicsOptionsMenu, MenuOption::PhysicsShowOwned);
|
||||
addCheckableActionToQMenuAndActionHash(physicsOptionsMenu, MenuOption::PhysicsShowHulls);
|
||||
|
||||
MenuWrapper* loginDialogFormatMenu = developerMenu->addMenu("Login Dialog");
|
||||
{
|
||||
QActionGroup* dialogMenuFormatGroup = new QActionGroup(loginDialogFormatMenu);
|
||||
|
||||
QAction* circularLoginDialog = addCheckableActionToQMenuAndActionHash(loginDialogFormatMenu,
|
||||
MenuOption::LoginDialogCircular, 0, false,
|
||||
dialogsManager.data(), SLOT(updateLoginDialogFormat()));
|
||||
dialogMenuFormatGroup->addAction(circularLoginDialog);
|
||||
|
||||
QAction* rectangularLoginDialog = addCheckableActionToQMenuAndActionHash(loginDialogFormatMenu,
|
||||
MenuOption::LoginDialogRectangular, 0, true,
|
||||
dialogsManager.data(), SLOT(updateLoginDialogFormat()));
|
||||
dialogMenuFormatGroup->addAction(rectangularLoginDialog);
|
||||
}
|
||||
|
||||
MenuWrapper* helpMenu = addMenu("Help");
|
||||
addActionToQMenuAndActionHash(helpMenu, MenuOption::EditEntitiesHelp, 0, qApp, SLOT(showEditEntitiesHelp()));
|
||||
|
||||
|
|
|
@ -209,6 +209,8 @@ namespace MenuOption {
|
|||
const QString LoadRSSDKFile = "Load .rssdk file";
|
||||
const QString LodTools = "LOD Tools";
|
||||
const QString Login = "Login";
|
||||
const QString LoginDialogCircular = "Circular";
|
||||
const QString LoginDialogRectangular = "Rectangular";
|
||||
const QString Log = "Log";
|
||||
const QString LowVelocityFilter = "Low Velocity Filter";
|
||||
const QString Mirror = "Mirror";
|
||||
|
|
|
@ -50,6 +50,10 @@ void DialogsManager::showLoginDialog() {
|
|||
LoginDialog::show();
|
||||
}
|
||||
|
||||
void DialogsManager::updateLoginDialogFormat() {
|
||||
emit loginDialogFormatChanged();
|
||||
}
|
||||
|
||||
void DialogsManager::octreeStatsDetails() {
|
||||
if (!_octreeStatsDialog) {
|
||||
_octreeStatsDialog = new OctreeStatsDialog(qApp->getWindow(), qApp->getOcteeSceneStats());
|
||||
|
|
|
@ -47,11 +47,15 @@ public:
|
|||
QPointer<OctreeStatsDialog> getOctreeStatsDialog() const { return _octreeStatsDialog; }
|
||||
QPointer<PreferencesDialog> getPreferencesDialog() const { return _preferencesDialog; }
|
||||
|
||||
signals:
|
||||
void loginDialogFormatChanged();
|
||||
|
||||
public slots:
|
||||
void toggleAddressBar();
|
||||
void toggleDiskCacheEditor();
|
||||
void toggleLoginDialog();
|
||||
void showLoginDialog();
|
||||
void updateLoginDialogFormat();
|
||||
void octreeStatsDetails();
|
||||
void cachesSizeDialog();
|
||||
void editPreferences();
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
//
|
||||
// LoginDialog.cpp
|
||||
// interface/src/ui
|
||||
//
|
||||
// Created by Bradley Austin Davis on 2015/04/14
|
||||
// Copyright 2015 High Fidelity, Inc.
|
||||
|
@ -8,20 +8,28 @@
|
|||
// Distributed under the Apache License, Version 2.0.
|
||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
//
|
||||
|
||||
#include "LoginDialog.h"
|
||||
|
||||
#include "DependencyManager.h"
|
||||
#include "AccountManager.h"
|
||||
#include "Menu.h"
|
||||
#include <NetworkingConstants.h>
|
||||
|
||||
#include "AccountManager.h"
|
||||
#include "DependencyManager.h"
|
||||
#include "Menu.h"
|
||||
|
||||
HIFI_QML_DEF(LoginDialog)
|
||||
|
||||
LoginDialog::LoginDialog(QQuickItem *parent) : OffscreenQmlDialog(parent), _rootUrl(NetworkingConstants::METAVERSE_SERVER_URL.toString()) {
|
||||
LoginDialog::LoginDialog(QQuickItem *parent) : OffscreenQmlDialog(parent),
|
||||
_dialogFormat("rectangular"),
|
||||
_rootUrl(NetworkingConstants::METAVERSE_SERVER_URL.toString())
|
||||
{
|
||||
connect(&AccountManager::getInstance(), &AccountManager::loginComplete,
|
||||
this, &LoginDialog::handleLoginCompleted);
|
||||
connect(&AccountManager::getInstance(), &AccountManager::loginFailed,
|
||||
this, &LoginDialog::handleLoginFailed);
|
||||
|
||||
connect(DependencyManager::get<DialogsManager>().data(), &DialogsManager::loginDialogFormatChanged,
|
||||
this, &LoginDialog::updateDialogFormat);
|
||||
}
|
||||
|
||||
void LoginDialog::toggleAction() {
|
||||
|
@ -51,6 +59,25 @@ void LoginDialog::handleLoginFailed() {
|
|||
setStatusText("<font color = \"#267077\">Invalid username or password.< / font>");
|
||||
}
|
||||
|
||||
void LoginDialog::setDialogFormat(const QString& dialogFormat) {
|
||||
if (dialogFormat != _dialogFormat) {
|
||||
_dialogFormat = dialogFormat;
|
||||
emit dialogFormatChanged();
|
||||
}
|
||||
}
|
||||
|
||||
QString LoginDialog::dialogFormat() const {
|
||||
return _dialogFormat;
|
||||
}
|
||||
|
||||
void LoginDialog::updateDialogFormat() {
|
||||
if (Menu::getInstance()->isOptionChecked(MenuOption::LoginDialogCircular)) {
|
||||
setDialogFormat("circular");
|
||||
} else {
|
||||
setDialogFormat("rectangular");
|
||||
}
|
||||
}
|
||||
|
||||
void LoginDialog::setStatusText(const QString& statusText) {
|
||||
if (statusText != _statusText) {
|
||||
_statusText = statusText;
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
//
|
||||
// LoginDialog.h
|
||||
// interface/src/ui
|
||||
//
|
||||
// Created by Bradley Austin Davis on 2015/04/14
|
||||
// Copyright 2015 High Fidelity, Inc.
|
||||
|
@ -9,9 +10,12 @@
|
|||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef hifi_LoginDialog_h
|
||||
#define hifi_LoginDialog_h
|
||||
|
||||
#include "DialogsManager.h" // Need before OffscreenQmlDialog.h in order to get gl.h and glew.h includes in correct order.
|
||||
|
||||
#include <OffscreenQmlDialog.h>
|
||||
|
||||
class LoginDialog : public OffscreenQmlDialog
|
||||
|
@ -19,6 +23,7 @@ class LoginDialog : public OffscreenQmlDialog
|
|||
Q_OBJECT
|
||||
HIFI_QML_DECL
|
||||
|
||||
Q_PROPERTY(QString dialogFormat READ dialogFormat WRITE setDialogFormat NOTIFY dialogFormatChanged)
|
||||
Q_PROPERTY(QString statusText READ statusText WRITE setStatusText NOTIFY statusTextChanged)
|
||||
Q_PROPERTY(QString rootUrl READ rootUrl)
|
||||
|
||||
|
@ -27,12 +32,17 @@ public:
|
|||
|
||||
LoginDialog(QQuickItem* parent = nullptr);
|
||||
|
||||
void setDialogFormat(const QString& dialogFormat);
|
||||
QString dialogFormat() const;
|
||||
void updateDialogFormat(); // protected?
|
||||
|
||||
void setStatusText(const QString& statusText);
|
||||
QString statusText() const;
|
||||
|
||||
QString rootUrl() const;
|
||||
|
||||
signals:
|
||||
void dialogFormatChanged();
|
||||
void statusTextChanged();
|
||||
|
||||
protected:
|
||||
|
@ -42,6 +52,7 @@ protected:
|
|||
Q_INVOKABLE void login(const QString& username, const QString& password);
|
||||
Q_INVOKABLE void openUrl(const QString& url);
|
||||
private:
|
||||
QString _dialogFormat;
|
||||
QString _statusText;
|
||||
const QString _rootUrl;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue