testing tablet implementation

This commit is contained in:
Wayne Chen 2018-10-30 11:48:22 -07:00
parent 8e4837f8c8
commit 43b269b612
3 changed files with 32 additions and 62 deletions

View file

@ -17,21 +17,15 @@ import "../windows" as Windows
import "../LoginDialog" import "../LoginDialog"
Windows.TabletModalWindow { FocusScope {
id: realRoot id: root
objectName: "LoginDialog" objectName: "LoginDialog"
visible: true
anchors.fill: parent
signal sendToScript(var message); signal sendToScript(var message);
property bool isHMD: false property bool isHMD: false
property bool gotoPreviousApp: false; property bool gotoPreviousApp: false;
color: hifi.colors.baseGray
title: qsTr("Sign in to High Fidelity")
property alias titleWidth: root.titleWidth
property alias punctuationMode: root.punctuationMode
//fake root for shared components expecting root here
property var root: QtObject {
id: root
property bool keyboardEnabled: false property bool keyboardEnabled: false
property bool keyboardRaised: false property bool keyboardRaised: false
@ -41,10 +35,6 @@ Windows.TabletModalWindow {
readonly property bool isTablet: true readonly property bool isTablet: true
property alias title: realRoot.title
property real width: realRoot.width
property real height: realRoot.height
property int titleWidth: 0 property int titleWidth: 0
property string iconText: hifi.glyphs.avatar property string iconText: hifi.glyphs.avatar
property int iconSize: 35 property int iconSize: 35
@ -57,11 +47,10 @@ Windows.TabletModalWindow {
function tryDestroy() { function tryDestroy() {
canceled() canceled()
} }
}
MouseArea { MouseArea {
width: realRoot.width width: root.width
height: realRoot.height height: root.height
} }
property bool keyboardOverride: true property bool keyboardOverride: true
@ -75,32 +64,13 @@ Windows.TabletModalWindow {
HifiStylesUit.HifiConstants { id: hifi } HifiStylesUit.HifiConstants { id: hifi }
Item {
id: mfRoot
readonly property int frameMarginTop: hifi.dimensions.modalDialogMargin.y readonly property int frameMarginTop: hifi.dimensions.modalDialogMargin.y
width: root.width
height: root.height + frameMarginTop + hifi.dimensions.contentMargin.x
anchors {
horizontalCenter: parent.horizontalCenter
verticalCenter: parent.verticalCenter
}
LoginDialog { LoginDialog {
id: loginDialog id: loginDialog
anchors {
fill: parent
topMargin: parent.frameMarginTop
horizontalCenter: parent.horizontalCenter
}
Loader { Loader {
id: bodyLoader id: bodyLoader
anchors.fill: parent
anchors.horizontalCenter: parent.horizontalCenter
}
} }
} }
@ -110,9 +80,9 @@ Windows.TabletModalWindow {
numeric: root.punctuationMode numeric: root.punctuationMode
password: root.isPassword password: root.isPassword
anchors { anchors {
left: parent.left left: bodyLoader.left
right: parent.right right: bodyLoader.right
bottom: parent.bottom top: bodyLoader.bottom
} }
} }
@ -138,7 +108,6 @@ Windows.TabletModalWindow {
} }
break break
} else switch (event.key) { } else switch (event.key) {
case Qt.Key_Enter: case Qt.Key_Enter:
case Qt.Key_Return: case Qt.Key_Return:
event.accepted = true event.accepted = true

View file

@ -29,7 +29,6 @@
#include "avatar/AvatarManager.h" #include "avatar/AvatarManager.h"
#include "scripting/HMDScriptingInterface.h" #include "scripting/HMDScriptingInterface.h"
#include "ui/overlays/Overlays.h" #include "ui/overlays/Overlays.h"
#include "ui/overlays/Web3DOverlay.h"
#include "Constants.h" #include "Constants.h"
HIFI_QML_DEF(LoginDialog) HIFI_QML_DEF(LoginDialog)
@ -75,8 +74,8 @@ void LoginDialog::showWithSelection() {
} else { } else {
tablet->initialScreen(TABLET_LOGIN_DIALOG_URL); tablet->initialScreen(TABLET_LOGIN_DIALOG_URL);
} }
} }
if (!hmd->getShouldShowTablet()) { if (!hmd->getShouldShowTablet()) {
hmd->openTablet(); hmd->openTablet();
} }

View file

@ -17,6 +17,8 @@
#include <OffscreenQmlDialog.h> #include <OffscreenQmlDialog.h>
#include <SettingHandle.h> #include <SettingHandle.h>
#include "ui/overlays/Web3DOverlay.h"
class QNetworkReply; class QNetworkReply;
class Web3DOverlay; class Web3DOverlay;