From 43b269b61206dacd9060b8d20e9e9de9a9a0bb4c Mon Sep 17 00:00:00 2001 From: Wayne Chen Date: Tue, 30 Oct 2018 11:48:22 -0700 Subject: [PATCH] testing tablet implementation --- .../qml/dialogs/TabletLoginDialog.qml | 89 ++++++------------- interface/src/ui/LoginDialog.cpp | 3 +- interface/src/ui/LoginDialog.h | 2 + 3 files changed, 32 insertions(+), 62 deletions(-) diff --git a/interface/resources/qml/dialogs/TabletLoginDialog.qml b/interface/resources/qml/dialogs/TabletLoginDialog.qml index 56b8eeec66..157fc27853 100644 --- a/interface/resources/qml/dialogs/TabletLoginDialog.qml +++ b/interface/resources/qml/dialogs/TabletLoginDialog.qml @@ -17,51 +17,40 @@ import "../windows" as Windows import "../LoginDialog" -Windows.TabletModalWindow { - id: realRoot +FocusScope { + id: root objectName: "LoginDialog" + visible: true + anchors.fill: parent signal sendToScript(var message); property bool isHMD: 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 keyboardRaised: false + property bool punctuationMode: false + property bool isPassword: false + property alias text: loginKeyboard.mirroredText - property bool keyboardEnabled: false - property bool keyboardRaised: false - property bool punctuationMode: false - property bool isPassword: false - property alias text: loginKeyboard.mirroredText + readonly property bool isTablet: true - readonly property bool isTablet: true + property int titleWidth: 0 + property string iconText: hifi.glyphs.avatar + property int iconSize: 35 - property alias title: realRoot.title - property real width: realRoot.width - property real height: realRoot.height + property var pane: QtObject { + property real width: root.width + property real height: root.height + } - property int titleWidth: 0 - property string iconText: hifi.glyphs.avatar - property int iconSize: 35 - - property var pane: QtObject { - property real width: root.width - property real height: root.height - } - - function tryDestroy() { - canceled() - } + function tryDestroy() { + canceled() } MouseArea { - width: realRoot.width - height: realRoot.height + width: root.width + height: root.height } property bool keyboardOverride: true @@ -75,32 +64,13 @@ Windows.TabletModalWindow { 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 + LoginDialog { + id: loginDialog - anchors { - horizontalCenter: parent.horizontalCenter - verticalCenter: parent.verticalCenter - } - - LoginDialog { - id: loginDialog - - anchors { - fill: parent - topMargin: parent.frameMarginTop - horizontalCenter: parent.horizontalCenter - } - - Loader { - id: bodyLoader - anchors.fill: parent - anchors.horizontalCenter: parent.horizontalCenter - } + Loader { + id: bodyLoader } } @@ -110,9 +80,9 @@ Windows.TabletModalWindow { numeric: root.punctuationMode password: root.isPassword anchors { - left: parent.left - right: parent.right - bottom: parent.bottom + left: bodyLoader.left + right: bodyLoader.right + top: bodyLoader.bottom } } @@ -138,7 +108,6 @@ Windows.TabletModalWindow { } break } else switch (event.key) { - case Qt.Key_Enter: case Qt.Key_Return: event.accepted = true diff --git a/interface/src/ui/LoginDialog.cpp b/interface/src/ui/LoginDialog.cpp index 1442cbe3ed..b30e9528d9 100644 --- a/interface/src/ui/LoginDialog.cpp +++ b/interface/src/ui/LoginDialog.cpp @@ -29,7 +29,6 @@ #include "avatar/AvatarManager.h" #include "scripting/HMDScriptingInterface.h" #include "ui/overlays/Overlays.h" -#include "ui/overlays/Web3DOverlay.h" #include "Constants.h" HIFI_QML_DEF(LoginDialog) @@ -75,8 +74,8 @@ void LoginDialog::showWithSelection() { } else { tablet->initialScreen(TABLET_LOGIN_DIALOG_URL); } - } + if (!hmd->getShouldShowTablet()) { hmd->openTablet(); } diff --git a/interface/src/ui/LoginDialog.h b/interface/src/ui/LoginDialog.h index dbc4dfc759..26036b8159 100644 --- a/interface/src/ui/LoginDialog.h +++ b/interface/src/ui/LoginDialog.h @@ -17,6 +17,8 @@ #include #include +#include "ui/overlays/Web3DOverlay.h" + class QNetworkReply; class Web3DOverlay;