mirror of
https://github.com/overte-org/overte.git
synced 2025-04-08 09:33:49 +02:00
better web view handling
This commit is contained in:
parent
b6901bba3e
commit
9658e1b8ac
4 changed files with 10 additions and 95 deletions
|
@ -147,7 +147,7 @@ Item {
|
|||
// desktop is not defined for web-entities
|
||||
if (stackRoot.isDesktop) {
|
||||
var component = Qt.createComponent("./Browser.qml");
|
||||
var newWindow = component.createObject(desktop);
|
||||
var newWindow = component.createObject(desktop);
|
||||
request.openIn(newWindow.webView);
|
||||
} else {
|
||||
var component = Qt.createComponent("./TabletBrowser.qml");
|
||||
|
@ -161,8 +161,9 @@ Item {
|
|||
var newWindow = component.createObject();
|
||||
//newWindow.setProfile(webview.profile);
|
||||
request.openIn(newWindow.webView);
|
||||
newWindow.eventBridge = web.eventBridge;
|
||||
stackRoot.push(newWindow);
|
||||
newWindow.forceActiveFocus();
|
||||
newWindow.webView.forceActiveFocus();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@ Item {
|
|||
property string address: url
|
||||
property alias scriptURL: root.userScriptUrl
|
||||
property alias eventBridge: eventBridgeWrapper.eventBridge
|
||||
property bool keyboardEnabled: HMD.active // FIXME - Keyboard HMD only: Default to false
|
||||
property bool keyboardEnabled: HMD.active
|
||||
property bool keyboardRaised: false
|
||||
property bool punctuationMode: false
|
||||
property bool isDesktop: false
|
||||
|
@ -230,6 +230,7 @@ Item {
|
|||
var newWindow = component.createObject();
|
||||
//newWindow.setProfile(root.profile);
|
||||
request.openIn(newWindow.webView);
|
||||
newWindow.eventBridge = web.eventBridge;
|
||||
stackRoot.push(newWindow);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ StackView {
|
|||
initialItem: addressBarDialog
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
|
||||
property var eventBridge;
|
||||
property var allStories: [];
|
||||
property int cardWidth: 460;
|
||||
property int cardHeight: 320;
|
||||
|
@ -59,6 +59,7 @@ StackView {
|
|||
if (0 !== targetString.indexOf('hifi://')) {
|
||||
var card = tabletStoryCard.createObject();
|
||||
card.setUrl(addressBarDialog.metaverseServerUrl + targetString);
|
||||
card.eventBridge = root.eventBridge;
|
||||
root.push(card);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -27,101 +27,13 @@ Rectangle {
|
|||
width: parent.width
|
||||
height: parent.height
|
||||
property string address: ""
|
||||
|
||||
property alias eventBridge: webview.eventBridge
|
||||
function setUrl(url) {
|
||||
cardRoot.address = url;
|
||||
webview.url = url;
|
||||
}
|
||||
|
||||
function goBack() {
|
||||
}
|
||||
|
||||
function visit() {
|
||||
}
|
||||
|
||||
/* Rectangle {
|
||||
id: header
|
||||
anchors {
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
top: parent.top
|
||||
}
|
||||
|
||||
width: parent.width
|
||||
height: 50
|
||||
color: hifi.colors.white
|
||||
|
||||
Row {
|
||||
anchors.fill: parent
|
||||
spacing: 80
|
||||
|
||||
Item {
|
||||
id: backButton
|
||||
anchors {
|
||||
top: parent.top
|
||||
left: parent.left
|
||||
leftMargin: 100
|
||||
}
|
||||
height: parent.height
|
||||
width: parent.height
|
||||
|
||||
HifiStyles.FiraSansSemiBold {
|
||||
text: "BACK"
|
||||
elide: Text.ElideRight
|
||||
anchors.fill: parent
|
||||
size: 16
|
||||
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
|
||||
color: hifi.colors.lightGray
|
||||
|
||||
MouseArea {
|
||||
id: backButtonMouseArea
|
||||
anchors.fill: parent
|
||||
hoverEnabled: enabled
|
||||
|
||||
onClicked: {
|
||||
webview.goBack();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Item {
|
||||
id: closeButton
|
||||
anchors {
|
||||
top: parent.top
|
||||
right: parent.right
|
||||
rightMargin: 100
|
||||
}
|
||||
height: parent.height
|
||||
width: parent.height
|
||||
|
||||
HifiStyles.FiraSansSemiBold {
|
||||
text: "CLOSE"
|
||||
elide: Text.ElideRight
|
||||
anchors.fill: parent
|
||||
size: 16
|
||||
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
|
||||
color: hifi.colors.lightGray
|
||||
|
||||
MouseArea {
|
||||
id: closeButtonMouseArea
|
||||
anchors.fill: parent
|
||||
hoverEnabled: enabled
|
||||
|
||||
onClicked: root.pop();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
HifiControls.WebView {
|
||||
|
||||
HifiControls.TabletWebView {
|
||||
id: webview
|
||||
parentStackItem: root
|
||||
anchors {
|
||||
|
|
Loading…
Reference in a new issue