mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 21:12:53 +02:00
Popupd support reworked
This commit is contained in:
parent
a33b2986cd
commit
874b9149e7
1 changed files with 159 additions and 96 deletions
|
@ -253,16 +253,44 @@ Rectangle {
|
|||
height: 2
|
||||
}
|
||||
|
||||
Component {
|
||||
id: webDialogComponent
|
||||
Rectangle {
|
||||
property alias webDialogView: webDialogView
|
||||
color: "white"
|
||||
HifiControls.BaseWebView {
|
||||
id: webEngineView
|
||||
id: webDialogView
|
||||
anchors.fill: parent
|
||||
|
||||
settings.autoLoadImages: true
|
||||
settings.javascriptEnabled: true
|
||||
settings.errorPageEnabled: true
|
||||
settings.pluginsEnabled: true
|
||||
settings.fullScreenSupportEnabled: true
|
||||
settings.autoLoadIconsForPage: true
|
||||
settings.touchIconsEnabled: true
|
||||
|
||||
onWindowCloseRequested: {
|
||||
webDialog.active = false
|
||||
webDialog.request = null
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Item {
|
||||
width: parent.width;
|
||||
property real webViewHeight: root.height - loadProgressBar.height - 48 - 4
|
||||
height: keyboardEnabled && keyboardRaised ? webViewHeight - keyboard.height : webViewHeight
|
||||
|
||||
HifiControls.BaseWebView {
|
||||
id: webEngineView
|
||||
anchors.fill: parent
|
||||
|
||||
focus: true
|
||||
objectName: "tabletWebEngineView"
|
||||
|
||||
url: "http://www.highfidelity.com"
|
||||
url: "https://www.highfidelity.com"
|
||||
|
||||
//profile: HFWebEngineProfile;
|
||||
|
||||
|
@ -329,8 +357,14 @@ Rectangle {
|
|||
}
|
||||
|
||||
onNewViewRequested: {
|
||||
console.error("new view requested:", request.destination)
|
||||
if (request.destination == WebEngineView.NewViewInDialog) {
|
||||
webDialog.request = request
|
||||
webDialog.active = true
|
||||
} else {
|
||||
request.openIn(webEngineView);
|
||||
}
|
||||
}
|
||||
|
||||
onRenderProcessTerminated: {
|
||||
var status = "";
|
||||
|
@ -349,11 +383,22 @@ Rectangle {
|
|||
break;
|
||||
}
|
||||
|
||||
print("Render process exited with code " + exitCode + " " + status);
|
||||
console.error("Render process exited with code " + exitCode + " " + status);
|
||||
reloadTimer.running = true;
|
||||
}
|
||||
|
||||
onFullScreenRequested: {
|
||||
console.error("FS requested:", request.destination)
|
||||
if (request.toggleOn) {
|
||||
webEngineView.state = "FullScreen";
|
||||
} else {
|
||||
webEngineView.state = "";
|
||||
}
|
||||
request.accept();
|
||||
}
|
||||
|
||||
onWindowCloseRequested: {
|
||||
console.error("window close requested:", request.destination)
|
||||
}
|
||||
|
||||
Timer {
|
||||
|
@ -364,6 +409,24 @@ Rectangle {
|
|||
onTriggered: webEngineView.reload()
|
||||
}
|
||||
}
|
||||
|
||||
Loader {
|
||||
id: webDialog
|
||||
property WebEngineNewViewRequest request: null
|
||||
anchors.fill: parent
|
||||
anchors.margins: 10
|
||||
|
||||
active: false
|
||||
sourceComponent: webDialogComponent
|
||||
onStatusChanged: {
|
||||
if (Loader.Ready === status) {
|
||||
focus = true
|
||||
item.webDialogView.profile = webEngineView.profile
|
||||
request.openIn(item.webDialogView)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue