diff --git a/interface/resources/qml/controls/WebView.qml b/interface/resources/qml/controls/WebView.qml index ae96590e97..b67948d651 100644 --- a/interface/resources/qml/controls/WebView.qml +++ b/interface/resources/qml/controls/WebView.qml @@ -101,11 +101,11 @@ Item { } onNewViewRequested:{ - // desktop is not defined for web-entities - if (desktop) { - var component = Qt.createComponent("../Browser.qml"); - var newWindow = component.createObject(desktop); - request.openIn(newWindow.webView); + // desktop is not defined for web-entities or tablet + if (typeof desktop !== "undefined") { + desktop.openBrowserWindow(request, profile); + } else { + console.log("onNewViewRequested: desktop not defined"); } } } diff --git a/interface/resources/qml/desktop/Desktop.qml b/interface/resources/qml/desktop/Desktop.qml index cc64d0f2b4..d8aedf6666 100644 --- a/interface/resources/qml/desktop/Desktop.qml +++ b/interface/resources/qml/desktop/Desktop.qml @@ -490,6 +490,13 @@ FocusScope { desktop.forceActiveFocus(); } + function openBrowserWindow(request, profile) { + var component = Qt.createComponent("../Browser.qml"); + var newWindow = component.createObject(desktop); + newWindow.webView.profile = profile; + request.openIn(newWindow.webView); + } + FocusHack { id: focusHack; } Rectangle { diff --git a/interface/resources/qml/hifi/Pal.qml b/interface/resources/qml/hifi/Pal.qml index 85a0402b9a..ae79c11d1a 100644 --- a/interface/resources/qml/hifi/Pal.qml +++ b/interface/resources/qml/hifi/Pal.qml @@ -16,8 +16,8 @@ import QtQuick.Controls 1.4 import QtGraphicalEffects 1.0 import Qt.labs.settings 1.0 import "../styles-uit" -import "../controls-uit" as HifiControls -import HFWebEngineProfile 1.0 +import "../controls-uit" as HifiControlsUit +import "../controls" as HifiControls // references HMD, Users, UserActivityLogger from root context @@ -161,7 +161,7 @@ Rectangle { horizontalAlignment: Text.AlignHCenter; verticalAlignment: Text.AlignTop; } - HifiControls.TabletComboBox { + HifiControlsUit.TabletComboBox { id: availabilityComboBox; // Anchors anchors.top: parent.top; @@ -240,7 +240,7 @@ Rectangle { verticalAlignment: Text.AlignVCenter; } // "In View" Checkbox - HifiControls.CheckBox { + HifiControlsUit.CheckBox { id: inViewCheckbox; visible: activeTab == "nearbyTab"; anchors.right: reloadNearbyContainer.left; @@ -260,7 +260,7 @@ Rectangle { anchors.rightMargin: 6; height: reloadNearby.height; width: height; - HifiControls.GlyphButton { + HifiControlsUit.GlyphButton { id: reloadNearby; width: reloadNearby.height; glyph: hifi.glyphs.reload; @@ -305,7 +305,7 @@ Rectangle { anchors.rightMargin: 6; height: reloadConnections.height; width: height; - HifiControls.GlyphButton { + HifiControlsUit.GlyphButton { id: reloadConnections; width: reloadConnections.height; glyph: hifi.glyphs.reload; @@ -494,7 +494,7 @@ Rectangle { } } // This TableView refers to the Nearby Table (on the "Nearby" tab below the current user's NameCard) - HifiControls.Table { + HifiControlsUit.Table { id: nearbyTable; // Anchors anchors.fill: parent; @@ -592,7 +592,7 @@ Rectangle { // Anchors anchors.left: parent.left; } - HifiControls.GlyphButton { + HifiControlsUit.GlyphButton { function getGlyph() { var fileName = "vol_"; if (model && model.personalMute) { @@ -626,7 +626,7 @@ Rectangle { // Clicking on the sides of the sorting header doesn't cause this problem. // I'm guessing this is a QT bug and not anything I can fix. I spent too long trying to work around it... // I'm just going to leave the minor visual bug in. - HifiControls.CheckBox { + HifiControlsUit.CheckBox { id: actionCheckBox; visible: isCheckBox; anchors.centerIn: parent; @@ -658,7 +658,7 @@ Rectangle { } // This Button belongs in the columns that contain the stateless action buttons ("Silence" & "Ban" for now) - HifiControls.Button { + HifiControlsUit.Button { id: actionButton; color: 2; // Red visible: isButton; @@ -831,7 +831,7 @@ Rectangle { } // This TableView refers to the Connections Table (on the "Connections" tab below the current user's NameCard) - HifiControls.Table { + HifiControlsUit.Table { id: connectionsTable; visible: !connectionsLoading.visible; // Anchors @@ -935,7 +935,7 @@ Rectangle { } // "Friends" checkbox - HifiControls.CheckBox { + HifiControlsUit.CheckBox { id: friendsCheckBox; visible: styleData.role === "friends"; anchors.centerIn: parent; @@ -960,7 +960,7 @@ Rectangle { } // "Connections" Tab } // palTabContainer - HifiControls.Keyboard { + HifiControlsUit.Keyboard { id: keyboard; raised: currentlyEditingDisplayName && HMD.mounted; numeric: parent.punctuationMode; @@ -1096,9 +1096,6 @@ Rectangle { HifiControls.WebView { id: userInfoViewer; - profile: HFWebEngineProfile { - storageName: "qmlWebEngine" - } anchors { top: navigationContainer.bottom; bottom: parent.bottom; diff --git a/interface/src/ui/overlays/Web3DOverlay.cpp b/interface/src/ui/overlays/Web3DOverlay.cpp index 7b9e075d64..90dcaafc21 100644 --- a/interface/src/ui/overlays/Web3DOverlay.cpp +++ b/interface/src/ui/overlays/Web3DOverlay.cpp @@ -39,6 +39,7 @@ #include "scripting/HMDScriptingInterface.h" #include #include "FileDialogHelper.h" +#include static const float DPI = 30.47f; static const float INCHES_TO_METERS = 1.0f / 39.3701f; @@ -177,6 +178,8 @@ void Web3DOverlay::loadSourceURL() { } } _webSurface->getRootContext()->setContextProperty("globalPosition", vec3toVariant(getPosition())); + auto offscreenUi = DependencyManager::get(); + _webSurface->getRootContext()->setContextProperty("desktop", offscreenUi->getDesktop()); } void Web3DOverlay::render(RenderArgs* args) {