From 4b30065ad191f3b0291e4b90f1b24549b98e58fd Mon Sep 17 00:00:00 2001 From: Anna Date: Wed, 12 Jun 2019 15:17:37 -0700 Subject: [PATCH 1/5] fixed keyboard on quest login and cleaned up qml files --- interface/resources/qml/LoginDialog.qml | 16 ++-- .../qml/dialogs/TabletLoginDialog.qml | 74 ++++++++++--------- libraries/ui/src/ui/OffscreenQmlSurface.cpp | 71 ++++++++++-------- 3 files changed, 90 insertions(+), 71 deletions(-) diff --git a/interface/resources/qml/LoginDialog.qml b/interface/resources/qml/LoginDialog.qml index 2d5c68c0e8..e3cd492edb 100644 --- a/interface/resources/qml/LoginDialog.qml +++ b/interface/resources/qml/LoginDialog.qml @@ -13,15 +13,14 @@ import QtQuick 2.4 import controlsUit 1.0 as HifiControlsUit import stylesUit 1.0 as HifiStylesUit -import "LoginDialog" - FocusScope { id: root - HifiStylesUit.HifiConstants { id: hifi } objectName: "LoginDialog" property bool shown: true visible: shown + HifiStylesUit.HifiConstants { id: hifi } + anchors.fill: parent readonly property bool isTablet: false @@ -33,12 +32,17 @@ FocusScope { property bool keyboardRaised: false property bool punctuationMode: false property bool isPassword: false - property string title: "" - property string text: "" - property int titleWidth: 0 + property alias bannerWidth: banner.width property alias bannerHeight: banner.height + property string title: "" + property string text: "" + + property int titleWidth: 0 + + property bool isHMD: HMD.active + function tryDestroy() { root.destroy() } diff --git a/interface/resources/qml/dialogs/TabletLoginDialog.qml b/interface/resources/qml/dialogs/TabletLoginDialog.qml index 8d6444bc0e..b01bb5b761 100644 --- a/interface/resources/qml/dialogs/TabletLoginDialog.qml +++ b/interface/resources/qml/dialogs/TabletLoginDialog.qml @@ -23,43 +23,36 @@ FocusScope { objectName: "LoginDialog" visible: true + HifiStylesUit.HifiConstants { id: hifi } + anchors.fill: parent - width: parent.width - height: parent.height - property var tabletProxy: Tablet.getTablet("com.highfidelity.interface.tablet.system"); - - property bool isHMD: HMD.active - property bool gotoPreviousApp: false; + readonly property bool isTablet: true + readonly property bool isOverlay: false + property string iconText: hifi.glyphs.avatar + property int iconSize: 35 property bool keyboardEnabled: false property bool keyboardRaised: false property bool punctuationMode: false property bool isPassword: false - readonly property bool isTablet: true - readonly property bool isOverlay: false - property alias text: loginKeyboard.mirroredText - - property int titleWidth: 0 property alias bannerWidth: banner.width property alias bannerHeight: banner.height - property string iconText: hifi.glyphs.avatar - property int iconSize: 35 - property var pane: QtObject { - property real width: root.width - property real height: root.height - } + property int titleWidth: 0 - function tryDestroy() { - tabletProxy.gotoHomeScreen(); - } + property bool isHMD: HMD.active - MouseArea { - width: root.width - height: root.height - } + // TABLET SPECIFIC PROPERTIES START // + property alias text: loginKeyboard.mirroredText + + width: parent.width + height: parent.height + + property var tabletProxy: Tablet.getTablet("com.highfidelity.interface.tablet.system") + + property bool gotoPreviousApp: false property bool keyboardOverride: true @@ -70,7 +63,20 @@ FocusScope { property alias loginDialog: loginDialog property alias hifi: hifi - HifiStylesUit.HifiConstants { id: hifi } + property var pane: QtObject { + property real width: root.width + property real height: root.height + } + + MouseArea { + width: root.width + height: root.height + } + // TABLET SPECIFIC PROPERTIES END // + + function tryDestroy() { + tabletProxy.gotoHomeScreen(); + } Timer { id: keyboardTimer @@ -102,6 +108,15 @@ FocusScope { anchors.fill: parent } + Rectangle { + z: -6 + id: opaqueRect + height: parent.height + width: parent.width + opacity: 0.65 + color: "black" + } + Item { z: -5 id: bannerContainer @@ -119,15 +134,6 @@ FocusScope { } } - Rectangle { - z: -6 - id: opaqueRect - height: parent.height - width: parent.width - opacity: 0.65 - color: "black" - } - HifiControlsUit.Keyboard { id: loginKeyboard raised: root.keyboardEnabled && root.keyboardRaised diff --git a/libraries/ui/src/ui/OffscreenQmlSurface.cpp b/libraries/ui/src/ui/OffscreenQmlSurface.cpp index ec0fad5ff0..975c067fbd 100644 --- a/libraries/ui/src/ui/OffscreenQmlSurface.cpp +++ b/libraries/ui/src/ui/OffscreenQmlSurface.cpp @@ -686,43 +686,52 @@ void OffscreenQmlSurface::setKeyboardRaised(QObject* object, bool raised, bool n return; } -#if !defined(Q_OS_ANDROID) - // if HMD is being worn, allow keyboard to open. allow it to close, HMD or not. - if (!raised || qApp->property(hifi::properties::HMD).toBool()) { - QQuickItem* item = dynamic_cast(object); - if (!item) { - return; - } + bool android; +#if defined(Q_OS_ANDROID) + android = true; +#endif - // for future probably makes sense to consider one of the following: - // 1. make keyboard a singleton, which will be dynamically re-parented before showing - // 2. track currently visible keyboard somewhere, allow to subscribe for this signal - // any of above should also eliminate need in duplicated properties and code below + bool hmd = qApp->property(hifi::properties::HMD).toBool(); - while (item) { - // Numeric value may be set in parameter from HTML UI; for QML UI, detect numeric fields here. - numeric = numeric || QString(item->metaObject()->className()).left(7) == "SpinBox"; - - if (item->property("keyboardRaised").isValid()) { - // FIXME - HMD only: Possibly set value of "keyboardEnabled" per isHMDMode() for use in WebView.qml. - if (item->property("punctuationMode").isValid()) { - item->setProperty("punctuationMode", QVariant(numeric)); - } - if (item->property("passwordField").isValid()) { - item->setProperty("passwordField", QVariant(passwordField)); - } - - if (raised) { - item->setProperty("keyboardRaised", QVariant(!raised)); - } - - item->setProperty("keyboardRaised", QVariant(raised)); + if (!android || hmd) { + // if HMD is being worn, allow keyboard to open. allow it to close, HMD or not. + if (!raised || hmd) { + QQuickItem* item = dynamic_cast(object); + if (!item) { return; } - item = dynamic_cast(item->parentItem()); + + // for future probably makes sense to consider one of the following: + // 1. make keyboard a singleton, which will be dynamically re-parented before showing + // 2. track currently visible keyboard somewhere, allow to subscribe for this signal + // any of above should also eliminate need in duplicated properties and code below + + while (item) { + // Numeric value may be set in parameter from HTML UI; for QML UI, detect numeric fields here. + numeric = numeric || QString(item->metaObject()->className()).left(7) == "SpinBox"; + + if (item->property("keyboardRaised").isValid()) { + + if (item->property("punctuationMode").isValid()) { + item->setProperty("punctuationMode", QVariant(numeric)); + } + if (item->property("passwordField").isValid()) { + item->setProperty("passwordField", QVariant(passwordField)); + } + + if (hmd && item->property("keyboardEnabled").isValid()) { + item->setProperty("keyboardEnabled", true); + } + + item->setProperty("keyboardRaised", QVariant(raised)); + + return; + } + item = dynamic_cast(item->parentItem()); + } } } -#endif + } void OffscreenQmlSurface::emitScriptEvent(const QVariant& message) { From 22803c70432c5c52ce804b60826b732e723f33ed Mon Sep 17 00:00:00 2001 From: Anna Date: Wed, 12 Jun 2019 17:14:40 -0700 Subject: [PATCH 2/5] testing --- BUILD.md | 1 + 1 file changed, 1 insertion(+) diff --git a/BUILD.md b/BUILD.md index bd264a74ad..c9bb48d4b7 100644 --- a/BUILD.md +++ b/BUILD.md @@ -106,3 +106,4 @@ The following build options can be used when running CMake #### Devices You can support external input/output devices such as Leap Motion, MIDI, and more by adding each individual SDK in the visible building path. Refer to the readme file available in each device folder in [interface/external/](interface/external) for the detailed explanation of the requirements to use the device. + \ No newline at end of file From 7099b04911251af65bd01ef1bfaf76f3d4fc52aa Mon Sep 17 00:00:00 2001 From: Anna Date: Thu, 13 Jun 2019 12:21:41 -0700 Subject: [PATCH 3/5] appeasing jenkins --- libraries/ui/src/ui/OffscreenQmlSurface.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/ui/src/ui/OffscreenQmlSurface.cpp b/libraries/ui/src/ui/OffscreenQmlSurface.cpp index 975c067fbd..34cac90a05 100644 --- a/libraries/ui/src/ui/OffscreenQmlSurface.cpp +++ b/libraries/ui/src/ui/OffscreenQmlSurface.cpp @@ -686,7 +686,7 @@ void OffscreenQmlSurface::setKeyboardRaised(QObject* object, bool raised, bool n return; } - bool android; + bool android = false; #if defined(Q_OS_ANDROID) android = true; #endif From 431ff0d1de2ca0d2cf49fe6192ee5de779cd6b68 Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Thu, 13 Jun 2019 15:35:08 -0700 Subject: [PATCH 4/5] fix drawcalls stat broken in pr-15721 --- interface/src/ui/Stats.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/src/ui/Stats.h b/interface/src/ui/Stats.h index 02ec62e6a5..b87e3a3dbc 100644 --- a/interface/src/ui/Stats.h +++ b/interface/src/ui/Stats.h @@ -262,7 +262,7 @@ class Stats : public QQuickItem { STATS_PROPERTY(int, processing, 0) STATS_PROPERTY(int, processingPending, 0) STATS_PROPERTY(int, triangles, 0) - STATS_PROPERTY(uint32_t, drawcalls, 0) + STATS_PROPERTY(quint32 , drawcalls, 0) STATS_PROPERTY(int, materialSwitches, 0) STATS_PROPERTY(int, itemConsidered, 0) STATS_PROPERTY(int, itemOutOfView, 0) From 503fc18d708adb787d58b41c1269640f737bf42f Mon Sep 17 00:00:00 2001 From: Zach Fox Date: Thu, 13 Jun 2019 16:08:29 -0700 Subject: [PATCH 5/5] Make this slightly more robust --- .../qml/hifi/simplifiedUI/topBar/SimplifiedTopBar.qml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/interface/resources/qml/hifi/simplifiedUI/topBar/SimplifiedTopBar.qml b/interface/resources/qml/hifi/simplifiedUI/topBar/SimplifiedTopBar.qml index 6e86849d03..42d53d3f79 100644 --- a/interface/resources/qml/hifi/simplifiedUI/topBar/SimplifiedTopBar.qml +++ b/interface/resources/qml/hifi/simplifiedUI/topBar/SimplifiedTopBar.qml @@ -48,7 +48,8 @@ Rectangle { onSkeletonModelURLChanged: { root.updatePreviewUrl(); - if (MyAvatar.skeletonModelURL.indexOf("defaultAvatar" > -1) && topBarInventoryModel.count > 0) { + if ((MyAvatar.skeletonModelURL.indexOf("defaultAvatar") > -1 || MyAvatar.skeletonModelURL.indexOf("fst") === -1) && + topBarInventoryModel.count > 0) { Settings.setValue("simplifiedUI/alreadyAutoSelectedAvatar", true); MyAvatar.skeletonModelURL = topBarInventoryModel.get(0).download_url; } @@ -100,7 +101,8 @@ Rectangle { inventoryFullyReceived = true; // If we have an avatar in our inventory AND we haven't already auto-selected an avatar... - if (!Settings.getValue("simplifiedUI/alreadyAutoSelectedAvatar", false) && topBarInventoryModel.count > 0) { + if ((!Settings.getValue("simplifiedUI/alreadyAutoSelectedAvatar", false) || + MyAvatar.skeletonModelURL.indexOf("defaultAvatar") > -1 || MyAvatar.skeletonModelURL.indexOf("fst") === -1) && topBarInventoryModel.count > 0) { Settings.setValue("simplifiedUI/alreadyAutoSelectedAvatar", true); MyAvatar.skeletonModelURL = topBarInventoryModel.get(0).download_url; }