mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 18:23:54 +02:00
forgot file
This commit is contained in:
parent
c8071e81b1
commit
0fcbc11419
1 changed files with 101 additions and 0 deletions
101
interface/resources/qml/OverlayLoginDialog.qml
Normal file
101
interface/resources/qml/OverlayLoginDialog.qml
Normal file
|
@ -0,0 +1,101 @@
|
|||
//
|
||||
// LoginDialog.qml
|
||||
//
|
||||
// Created by Wayne Chen
|
||||
// Copyright 2018 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 "qrc:////qml//controls-uit" as HifiControlsUit
|
||||
import "qrc:////qml//styles-uit" as HifiStylesUit
|
||||
|
||||
import "LoginDialog"
|
||||
|
||||
FocusScope {
|
||||
id: root
|
||||
HifiStylesUit.HifiConstants { id: hifi }
|
||||
objectName: "LoginDialog"
|
||||
visible: true
|
||||
|
||||
anchors.fill: parent
|
||||
|
||||
readonly property bool isTablet: false
|
||||
readonly property bool isOverlay: true
|
||||
property bool keyboardEnabled: false
|
||||
property bool keyboardRaised: false
|
||||
property bool punctuationMode: false
|
||||
property bool isPassword: false
|
||||
property string iconText: ""
|
||||
property int iconSize: 50
|
||||
|
||||
property string title: ""
|
||||
property int titleWidth: 0
|
||||
property alias text: loginKeyboard.mirroredText
|
||||
|
||||
function tryDestroy() {
|
||||
root.destroy()
|
||||
}
|
||||
|
||||
LoginDialog {
|
||||
id: loginDialog
|
||||
anchors.fill: parent
|
||||
Loader {
|
||||
id: bodyLoader
|
||||
anchors.fill: parent
|
||||
}
|
||||
}
|
||||
HifiControlsUit.Keyboard {
|
||||
id: loginKeyboard
|
||||
raised: root.keyboardEnabled && root.keyboardRaised
|
||||
numeric: root.punctuationMode
|
||||
password: root.isPassword
|
||||
anchors {
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
bottom: parent.bottom
|
||||
}
|
||||
}
|
||||
|
||||
Keys.onPressed: {
|
||||
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_Back:
|
||||
event.accepted = true
|
||||
break
|
||||
|
||||
case Qt.Key_Enter:
|
||||
case Qt.Key_Return:
|
||||
event.accepted = true
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
bodyLoader.setSource("LoginDialog/LinkAccountBody.qml", { "loginDialog": loginDialog, "root": root, "bodyLoader": bodyLoader });
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue