mirror of
https://github.com/overte-org/overte.git
synced 2025-04-08 01:12:48 +02:00
Merge pull request #10104 from druiz17/tablet-webView3.0
Remove unnecessary prints and code for tabletWebView.qml
This commit is contained in:
commit
cb787c2862
2 changed files with 26 additions and 48 deletions
|
@ -110,7 +110,6 @@ Item {
|
|||
Component.onCompleted: {
|
||||
// Ensure the JS from the web-engine makes it to our logging
|
||||
webview.javaScriptConsoleMessage.connect(function(level, message, lineNumber, sourceID) {
|
||||
console.log("TabletBrowser");
|
||||
console.log("Web Entity JS message: " + sourceID + " " + lineNumber + " " + message);
|
||||
});
|
||||
|
||||
|
@ -138,33 +137,22 @@ Item {
|
|||
}
|
||||
}
|
||||
|
||||
onActiveFocusOnPressChanged: {
|
||||
console.log("on active focus changed");
|
||||
setActiveFocusOnPress(true);
|
||||
}
|
||||
|
||||
onNewViewRequested:{
|
||||
// desktop is not defined for web-entities
|
||||
if (stackRoot.isDesktop) {
|
||||
var component = Qt.createComponent("./Browser.qml");
|
||||
var newWindow = component.createObject(desktop);
|
||||
request.openIn(newWindow.webView);
|
||||
} else {
|
||||
var component = Qt.createComponent("./TabletBrowser.qml");
|
||||
|
||||
if (component.status != Component.Ready) {
|
||||
if (component.status == Component.Error) {
|
||||
console.log("Error: " + component.errorString());
|
||||
}
|
||||
return;
|
||||
onNewViewRequested: {
|
||||
var component = Qt.createComponent("./TabletBrowser.qml");
|
||||
|
||||
if (component.status != Component.Ready) {
|
||||
if (component.status == Component.Error) {
|
||||
console.log("Error: " + component.errorString());
|
||||
}
|
||||
var newWindow = component.createObject();
|
||||
newWindow.setProfile(webview.profile);
|
||||
request.openIn(newWindow.webView);
|
||||
newWindow.eventBridge = web.eventBridge;
|
||||
stackRoot.push(newWindow);
|
||||
newWindow.webView.forceActiveFocus();
|
||||
return;
|
||||
}
|
||||
var newWindow = component.createObject();
|
||||
newWindow.setProfile(webview.profile);
|
||||
request.openIn(newWindow.webView);
|
||||
newWindow.eventBridge = web.eventBridge;
|
||||
stackRoot.push(newWindow);
|
||||
newWindow.webView.forceActiveFocus();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -112,6 +112,7 @@ Item {
|
|||
currentItem.goBack();
|
||||
} else {
|
||||
stackRoot.pop();
|
||||
currentItem.webView.focus = true;
|
||||
currentItem.webView.forceActiveFocus();
|
||||
web.address = currentItem.webView.url;
|
||||
}
|
||||
|
@ -186,7 +187,6 @@ Item {
|
|||
Component.onCompleted: {
|
||||
// Ensure the JS from the web-engine makes it to our logging
|
||||
root.javaScriptConsoleMessage.connect(function(level, message, lineNumber, sourceID) {
|
||||
console.log("WebView.qml");
|
||||
console.log("Web Entity JS message: " + sourceID + " " + lineNumber + " " + message);
|
||||
});
|
||||
|
||||
|
@ -202,7 +202,6 @@ Item {
|
|||
keyboardRaised = false;
|
||||
punctuationMode = false;
|
||||
keyboard.resetShiftMode(false);
|
||||
console.log("[DR] -> printing user string " + root.profile.httpUserAgent);
|
||||
// Required to support clicking on "hifi://" links
|
||||
if (WebEngineView.LoadStartedStatus == loadRequest.status) {
|
||||
var url = loadRequest.url.toString();
|
||||
|
@ -215,30 +214,21 @@ Item {
|
|||
}
|
||||
|
||||
onNewViewRequested:{
|
||||
// desktop is not defined for web-entities
|
||||
if (web.isDesktop) {
|
||||
var component = Qt.createComponent("../Browser.qml");
|
||||
var newWindow = component.createObject(desktop);
|
||||
newWindow.setProfile(root.profile);
|
||||
request.openIn(newWindow.webView);
|
||||
} else {
|
||||
var component = Qt.createComponent("../TabletBrowser.qml");
|
||||
|
||||
if (component.status != Component.Ready) {
|
||||
if (component.status == Component.Error) {
|
||||
console.log("Error: " + component.errorString());
|
||||
}
|
||||
return;
|
||||
var component = Qt.createComponent("../TabletBrowser.qml");
|
||||
if (component.status != Component.Ready) {
|
||||
if (component.status == Component.Error) {
|
||||
console.log("Error: " + component.errorString());
|
||||
}
|
||||
var newWindow = component.createObject();
|
||||
newWindow.setProfile(root.profile);
|
||||
request.openIn(newWindow.webView);
|
||||
newWindow.eventBridge = web.eventBridge;
|
||||
stackRoot.push(newWindow);
|
||||
return;
|
||||
}
|
||||
var newWindow = component.createObject();
|
||||
newWindow.setProfile(root.profile);
|
||||
request.openIn(newWindow.webView);
|
||||
newWindow.eventBridge = web.eventBridge;
|
||||
stackRoot.push(newWindow);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
HiFiControls.Keyboard {
|
||||
id: keyboard
|
||||
raised: web.keyboardEnabled && web.keyboardRaised
|
||||
|
|
Loading…
Reference in a new issue