mirror of
https://github.com/overte-org/overte.git
synced 2025-08-07 01:09:27 +02:00
Make tablet popups work like they should
This commit is contained in:
parent
2552e572a7
commit
05fec328c0
4 changed files with 28 additions and 21 deletions
|
@ -101,11 +101,11 @@ Item {
|
||||||
}
|
}
|
||||||
|
|
||||||
onNewViewRequested:{
|
onNewViewRequested:{
|
||||||
// desktop is not defined for web-entities
|
// desktop is not defined for web-entities or tablet
|
||||||
if (desktop) {
|
if (typeof desktop !== "undefined") {
|
||||||
var component = Qt.createComponent("../Browser.qml");
|
desktop.openBrowserWindow(request, profile);
|
||||||
var newWindow = component.createObject(desktop);
|
} else {
|
||||||
request.openIn(newWindow.webView);
|
console.log("onNewViewRequested: desktop not defined");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -490,6 +490,13 @@ FocusScope {
|
||||||
desktop.forceActiveFocus();
|
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; }
|
FocusHack { id: focusHack; }
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
|
|
|
@ -16,8 +16,8 @@ import QtQuick.Controls 1.4
|
||||||
import QtGraphicalEffects 1.0
|
import QtGraphicalEffects 1.0
|
||||||
import Qt.labs.settings 1.0
|
import Qt.labs.settings 1.0
|
||||||
import "../styles-uit"
|
import "../styles-uit"
|
||||||
import "../controls-uit" as HifiControls
|
import "../controls-uit" as HifiControlsUit
|
||||||
import HFWebEngineProfile 1.0
|
import "../controls" as HifiControls
|
||||||
|
|
||||||
// references HMD, Users, UserActivityLogger from root context
|
// references HMD, Users, UserActivityLogger from root context
|
||||||
|
|
||||||
|
@ -161,7 +161,7 @@ Rectangle {
|
||||||
horizontalAlignment: Text.AlignHCenter;
|
horizontalAlignment: Text.AlignHCenter;
|
||||||
verticalAlignment: Text.AlignTop;
|
verticalAlignment: Text.AlignTop;
|
||||||
}
|
}
|
||||||
HifiControls.TabletComboBox {
|
HifiControlsUit.TabletComboBox {
|
||||||
id: availabilityComboBox;
|
id: availabilityComboBox;
|
||||||
// Anchors
|
// Anchors
|
||||||
anchors.top: parent.top;
|
anchors.top: parent.top;
|
||||||
|
@ -240,7 +240,7 @@ Rectangle {
|
||||||
verticalAlignment: Text.AlignVCenter;
|
verticalAlignment: Text.AlignVCenter;
|
||||||
}
|
}
|
||||||
// "In View" Checkbox
|
// "In View" Checkbox
|
||||||
HifiControls.CheckBox {
|
HifiControlsUit.CheckBox {
|
||||||
id: inViewCheckbox;
|
id: inViewCheckbox;
|
||||||
visible: activeTab == "nearbyTab";
|
visible: activeTab == "nearbyTab";
|
||||||
anchors.right: reloadNearbyContainer.left;
|
anchors.right: reloadNearbyContainer.left;
|
||||||
|
@ -260,7 +260,7 @@ Rectangle {
|
||||||
anchors.rightMargin: 6;
|
anchors.rightMargin: 6;
|
||||||
height: reloadNearby.height;
|
height: reloadNearby.height;
|
||||||
width: height;
|
width: height;
|
||||||
HifiControls.GlyphButton {
|
HifiControlsUit.GlyphButton {
|
||||||
id: reloadNearby;
|
id: reloadNearby;
|
||||||
width: reloadNearby.height;
|
width: reloadNearby.height;
|
||||||
glyph: hifi.glyphs.reload;
|
glyph: hifi.glyphs.reload;
|
||||||
|
@ -305,7 +305,7 @@ Rectangle {
|
||||||
anchors.rightMargin: 6;
|
anchors.rightMargin: 6;
|
||||||
height: reloadConnections.height;
|
height: reloadConnections.height;
|
||||||
width: height;
|
width: height;
|
||||||
HifiControls.GlyphButton {
|
HifiControlsUit.GlyphButton {
|
||||||
id: reloadConnections;
|
id: reloadConnections;
|
||||||
width: reloadConnections.height;
|
width: reloadConnections.height;
|
||||||
glyph: hifi.glyphs.reload;
|
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)
|
// This TableView refers to the Nearby Table (on the "Nearby" tab below the current user's NameCard)
|
||||||
HifiControls.Table {
|
HifiControlsUit.Table {
|
||||||
id: nearbyTable;
|
id: nearbyTable;
|
||||||
// Anchors
|
// Anchors
|
||||||
anchors.fill: parent;
|
anchors.fill: parent;
|
||||||
|
@ -592,7 +592,7 @@ Rectangle {
|
||||||
// Anchors
|
// Anchors
|
||||||
anchors.left: parent.left;
|
anchors.left: parent.left;
|
||||||
}
|
}
|
||||||
HifiControls.GlyphButton {
|
HifiControlsUit.GlyphButton {
|
||||||
function getGlyph() {
|
function getGlyph() {
|
||||||
var fileName = "vol_";
|
var fileName = "vol_";
|
||||||
if (model && model.personalMute) {
|
if (model && model.personalMute) {
|
||||||
|
@ -626,7 +626,7 @@ Rectangle {
|
||||||
// Clicking on the sides of the sorting header doesn't cause this problem.
|
// 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 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.
|
// I'm just going to leave the minor visual bug in.
|
||||||
HifiControls.CheckBox {
|
HifiControlsUit.CheckBox {
|
||||||
id: actionCheckBox;
|
id: actionCheckBox;
|
||||||
visible: isCheckBox;
|
visible: isCheckBox;
|
||||||
anchors.centerIn: parent;
|
anchors.centerIn: parent;
|
||||||
|
@ -658,7 +658,7 @@ Rectangle {
|
||||||
}
|
}
|
||||||
|
|
||||||
// This Button belongs in the columns that contain the stateless action buttons ("Silence" & "Ban" for now)
|
// This Button belongs in the columns that contain the stateless action buttons ("Silence" & "Ban" for now)
|
||||||
HifiControls.Button {
|
HifiControlsUit.Button {
|
||||||
id: actionButton;
|
id: actionButton;
|
||||||
color: 2; // Red
|
color: 2; // Red
|
||||||
visible: isButton;
|
visible: isButton;
|
||||||
|
@ -831,7 +831,7 @@ Rectangle {
|
||||||
}
|
}
|
||||||
|
|
||||||
// This TableView refers to the Connections Table (on the "Connections" tab below the current user's NameCard)
|
// This TableView refers to the Connections Table (on the "Connections" tab below the current user's NameCard)
|
||||||
HifiControls.Table {
|
HifiControlsUit.Table {
|
||||||
id: connectionsTable;
|
id: connectionsTable;
|
||||||
visible: !connectionsLoading.visible;
|
visible: !connectionsLoading.visible;
|
||||||
// Anchors
|
// Anchors
|
||||||
|
@ -935,7 +935,7 @@ Rectangle {
|
||||||
}
|
}
|
||||||
|
|
||||||
// "Friends" checkbox
|
// "Friends" checkbox
|
||||||
HifiControls.CheckBox {
|
HifiControlsUit.CheckBox {
|
||||||
id: friendsCheckBox;
|
id: friendsCheckBox;
|
||||||
visible: styleData.role === "friends";
|
visible: styleData.role === "friends";
|
||||||
anchors.centerIn: parent;
|
anchors.centerIn: parent;
|
||||||
|
@ -960,7 +960,7 @@ Rectangle {
|
||||||
} // "Connections" Tab
|
} // "Connections" Tab
|
||||||
} // palTabContainer
|
} // palTabContainer
|
||||||
|
|
||||||
HifiControls.Keyboard {
|
HifiControlsUit.Keyboard {
|
||||||
id: keyboard;
|
id: keyboard;
|
||||||
raised: currentlyEditingDisplayName && HMD.mounted;
|
raised: currentlyEditingDisplayName && HMD.mounted;
|
||||||
numeric: parent.punctuationMode;
|
numeric: parent.punctuationMode;
|
||||||
|
@ -1096,9 +1096,6 @@ Rectangle {
|
||||||
|
|
||||||
HifiControls.WebView {
|
HifiControls.WebView {
|
||||||
id: userInfoViewer;
|
id: userInfoViewer;
|
||||||
profile: HFWebEngineProfile {
|
|
||||||
storageName: "qmlWebEngine"
|
|
||||||
}
|
|
||||||
anchors {
|
anchors {
|
||||||
top: navigationContainer.bottom;
|
top: navigationContainer.bottom;
|
||||||
bottom: parent.bottom;
|
bottom: parent.bottom;
|
||||||
|
|
|
@ -39,6 +39,7 @@
|
||||||
#include "scripting/HMDScriptingInterface.h"
|
#include "scripting/HMDScriptingInterface.h"
|
||||||
#include <Preferences.h>
|
#include <Preferences.h>
|
||||||
#include "FileDialogHelper.h"
|
#include "FileDialogHelper.h"
|
||||||
|
#include <OffscreenUi.h>
|
||||||
|
|
||||||
static const float DPI = 30.47f;
|
static const float DPI = 30.47f;
|
||||||
static const float INCHES_TO_METERS = 1.0f / 39.3701f;
|
static const float INCHES_TO_METERS = 1.0f / 39.3701f;
|
||||||
|
@ -177,6 +178,8 @@ void Web3DOverlay::loadSourceURL() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_webSurface->getRootContext()->setContextProperty("globalPosition", vec3toVariant(getPosition()));
|
_webSurface->getRootContext()->setContextProperty("globalPosition", vec3toVariant(getPosition()));
|
||||||
|
auto offscreenUi = DependencyManager::get<OffscreenUi>();
|
||||||
|
_webSurface->getRootContext()->setContextProperty("desktop", offscreenUi->getDesktop());
|
||||||
}
|
}
|
||||||
|
|
||||||
void Web3DOverlay::render(RenderArgs* args) {
|
void Web3DOverlay::render(RenderArgs* args) {
|
||||||
|
|
Loading…
Reference in a new issue