mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 07:19:05 +02:00
Fixing desktop QML loading, tablet clickthrough bugs
This commit is contained in:
parent
2cd76be6c4
commit
b7f31eb5b9
2 changed files with 67 additions and 28 deletions
|
@ -202,8 +202,16 @@ Item {
|
||||||
}
|
}
|
||||||
|
|
||||||
function load(newSource, callback) {
|
function load(newSource, callback) {
|
||||||
loader.source = newSource;
|
if (loader.source == newSource) {
|
||||||
|
loader.loaded();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (loader.item) {
|
||||||
|
loader.item.destroy();
|
||||||
loader.item = null;
|
loader.item = null;
|
||||||
|
}
|
||||||
|
|
||||||
QmlSurface.load(newSource, loader, function(newItem) {
|
QmlSurface.load(newSource, loader, function(newItem) {
|
||||||
loader.item = newItem;
|
loader.item = newItem;
|
||||||
loader.item.width = loader.width;
|
loader.item.width = loader.width;
|
||||||
|
@ -232,7 +240,6 @@ Item {
|
||||||
callback();
|
callback();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
console.log("QQQ done calling QmlSurface.load")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -59,18 +59,15 @@ Windows.ScrollingWindow {
|
||||||
}
|
}
|
||||||
|
|
||||||
function loadSource(url) {
|
function loadSource(url) {
|
||||||
loader.source = ""; // make sure we load the qml fresh each time.
|
loader.load(url)
|
||||||
loader.source = url;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function loadWebBase() {
|
function loadWebBase() {
|
||||||
loader.source = "";
|
loader.load("hifi/tablet/TabletWebView.qml");
|
||||||
loader.source = "WindowWebView.qml";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function loadTabletWebBase() {
|
function loadTabletWebBase() {
|
||||||
loader.source = "";
|
loader.load("hifi/tablet/BlocksWebView.qml");
|
||||||
loader.source = "./BlocksWebView.qml";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function loadWebUrl(url, injectedJavaScriptUrl) {
|
function loadWebUrl(url, injectedJavaScriptUrl) {
|
||||||
|
@ -111,16 +108,6 @@ Windows.ScrollingWindow {
|
||||||
username = newUsername;
|
username = newUsername;
|
||||||
}
|
}
|
||||||
|
|
||||||
Loader {
|
|
||||||
id: loader
|
|
||||||
objectName: "loader"
|
|
||||||
asynchronous: false
|
|
||||||
|
|
||||||
height: pane.scrollHeight
|
|
||||||
width: pane.contentWidth
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.top: parent.top
|
|
||||||
|
|
||||||
// Hook up callback for clara.io download from the marketplace.
|
// Hook up callback for clara.io download from the marketplace.
|
||||||
Connections {
|
Connections {
|
||||||
id: eventBridgeConnection
|
id: eventBridgeConnection
|
||||||
|
@ -132,7 +119,46 @@ Windows.ScrollingWindow {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onLoaded: {
|
Item {
|
||||||
|
id: loader
|
||||||
|
objectName: "loader";
|
||||||
|
property string source: "";
|
||||||
|
property var item: null;
|
||||||
|
|
||||||
|
height: pane.scrollHeight
|
||||||
|
width: pane.contentWidth
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.top: parent.top
|
||||||
|
signal loaded;
|
||||||
|
|
||||||
|
onWidthChanged: {
|
||||||
|
if (loader.item) {
|
||||||
|
loader.item.width = loader.width;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onHeightChanged: {
|
||||||
|
if (loader.item) {
|
||||||
|
loader.item.height = loader.height;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function load(newSource, callback) {
|
||||||
|
if (loader.source == newSource) {
|
||||||
|
loader.loaded();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (loader.item) {
|
||||||
|
loader.item.destroy();
|
||||||
|
loader.item = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
QmlSurface.load(newSource, loader, function(newItem) {
|
||||||
|
loader.item = newItem;
|
||||||
|
loader.item.width = loader.width;
|
||||||
|
loader.item.height = loader.height;
|
||||||
|
loader.loaded();
|
||||||
if (loader.item.hasOwnProperty("sendToScript")) {
|
if (loader.item.hasOwnProperty("sendToScript")) {
|
||||||
loader.item.sendToScript.connect(tabletRoot.sendToScript);
|
loader.item.sendToScript.connect(tabletRoot.sendToScript);
|
||||||
}
|
}
|
||||||
|
@ -140,9 +166,15 @@ Windows.ScrollingWindow {
|
||||||
loader.item.setRootMenu(tabletRoot.rootMenu, tabletRoot.subMenu);
|
loader.item.setRootMenu(tabletRoot.rootMenu, tabletRoot.subMenu);
|
||||||
}
|
}
|
||||||
loader.item.forceActiveFocus();
|
loader.item.forceActiveFocus();
|
||||||
|
|
||||||
|
if (callback) {
|
||||||
|
callback();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
implicitWidth: 480
|
implicitWidth: 480
|
||||||
implicitHeight: 706
|
implicitHeight: 706
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue