mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-06-28 04:10:56 +02:00
better web view handling
This commit is contained in:
parent
b6901bba3e
commit
9658e1b8ac
4 changed files with 10 additions and 95 deletions
|
@ -161,8 +161,9 @@ Item {
|
||||||
var newWindow = component.createObject();
|
var newWindow = component.createObject();
|
||||||
//newWindow.setProfile(webview.profile);
|
//newWindow.setProfile(webview.profile);
|
||||||
request.openIn(newWindow.webView);
|
request.openIn(newWindow.webView);
|
||||||
|
newWindow.eventBridge = web.eventBridge;
|
||||||
stackRoot.push(newWindow);
|
stackRoot.push(newWindow);
|
||||||
newWindow.forceActiveFocus();
|
newWindow.webView.forceActiveFocus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,7 @@ Item {
|
||||||
property string address: url
|
property string address: url
|
||||||
property alias scriptURL: root.userScriptUrl
|
property alias scriptURL: root.userScriptUrl
|
||||||
property alias eventBridge: eventBridgeWrapper.eventBridge
|
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 keyboardRaised: false
|
||||||
property bool punctuationMode: false
|
property bool punctuationMode: false
|
||||||
property bool isDesktop: false
|
property bool isDesktop: false
|
||||||
|
@ -230,6 +230,7 @@ Item {
|
||||||
var newWindow = component.createObject();
|
var newWindow = component.createObject();
|
||||||
//newWindow.setProfile(root.profile);
|
//newWindow.setProfile(root.profile);
|
||||||
request.openIn(newWindow.webView);
|
request.openIn(newWindow.webView);
|
||||||
|
newWindow.eventBridge = web.eventBridge;
|
||||||
stackRoot.push(newWindow);
|
stackRoot.push(newWindow);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,7 @@ StackView {
|
||||||
initialItem: addressBarDialog
|
initialItem: addressBarDialog
|
||||||
width: parent.width
|
width: parent.width
|
||||||
height: parent.height
|
height: parent.height
|
||||||
|
property var eventBridge;
|
||||||
property var allStories: [];
|
property var allStories: [];
|
||||||
property int cardWidth: 460;
|
property int cardWidth: 460;
|
||||||
property int cardHeight: 320;
|
property int cardHeight: 320;
|
||||||
|
@ -59,6 +59,7 @@ StackView {
|
||||||
if (0 !== targetString.indexOf('hifi://')) {
|
if (0 !== targetString.indexOf('hifi://')) {
|
||||||
var card = tabletStoryCard.createObject();
|
var card = tabletStoryCard.createObject();
|
||||||
card.setUrl(addressBarDialog.metaverseServerUrl + targetString);
|
card.setUrl(addressBarDialog.metaverseServerUrl + targetString);
|
||||||
|
card.eventBridge = root.eventBridge;
|
||||||
root.push(card);
|
root.push(card);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,101 +27,13 @@ Rectangle {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
height: parent.height
|
height: parent.height
|
||||||
property string address: ""
|
property string address: ""
|
||||||
|
property alias eventBridge: webview.eventBridge
|
||||||
function setUrl(url) {
|
function setUrl(url) {
|
||||||
cardRoot.address = url;
|
cardRoot.address = url;
|
||||||
webview.url = url;
|
webview.url = url;
|
||||||
}
|
}
|
||||||
|
|
||||||
function goBack() {
|
HifiControls.TabletWebView {
|
||||||
}
|
|
||||||
|
|
||||||
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 {
|
|
||||||
id: webview
|
id: webview
|
||||||
parentStackItem: root
|
parentStackItem: root
|
||||||
anchors {
|
anchors {
|
||||||
|
|
Loading…
Reference in a new issue