mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
Switch off Flickable
This commit is contained in:
parent
cb2911f3e0
commit
c6d3bce704
4 changed files with 59 additions and 29 deletions
|
@ -14,25 +14,28 @@ Flickable {
|
|||
property alias webViewCore: _webview
|
||||
property alias webViewCoreProfile: _webview.profile
|
||||
|
||||
interactive: true
|
||||
property string userScriptUrl: ""
|
||||
property string urlTag: "noDownload=false";
|
||||
|
||||
signal newViewRequestedCallback(var request)
|
||||
signal loadingChangedCallback(var loadRequest)
|
||||
|
||||
property real previousHeight: height
|
||||
|
||||
boundsBehavior: Flickable.StopAtBounds
|
||||
|
||||
StylesUIt.HifiConstants {
|
||||
id: hifi
|
||||
}
|
||||
|
||||
onHeightChanged: {
|
||||
if (height > 0) {
|
||||
//reload page since window dimentions changed,
|
||||
//so web engine should recalculate page render dimentions
|
||||
reloadTimer.start()
|
||||
}
|
||||
}
|
||||
// onHeightChanged: {
|
||||
// if (height > 0) {
|
||||
// //reload page since window dimentions changed,
|
||||
// //so web engine should recalculate page render dimentions
|
||||
// reloadTimer.start()
|
||||
// }
|
||||
// }
|
||||
|
||||
ScrollBar.vertical: ScrollBar {
|
||||
id: scrollBar
|
||||
|
@ -48,8 +51,8 @@ Flickable {
|
|||
|
||||
function onLoadingChanged(loadRequest) {
|
||||
if (WebEngineView.LoadStartedStatus === loadRequest.status) {
|
||||
flick.contentWidth = flick.width
|
||||
flick.contentHeight = flick.height
|
||||
// flick.contentWidth = flick.width
|
||||
// flick.contentHeight = flick.height
|
||||
|
||||
// Required to support clicking on "hifi://" links
|
||||
var url = loadRequest.url.toString();
|
||||
|
@ -58,24 +61,47 @@ Flickable {
|
|||
_webview.stop();
|
||||
}
|
||||
}
|
||||
heightTimer.stop()
|
||||
}
|
||||
|
||||
if (WebEngineView.LoadFailedStatus === loadRequest.status) {
|
||||
console.log(" Tablet WebEngineView failed to load url: " + loadRequest.url.toString());
|
||||
heightTimer.stop()
|
||||
}
|
||||
|
||||
if (WebEngineView.LoadSucceededStatus === loadRequest.status) {
|
||||
//disable Chromium's scroll bars
|
||||
_webview.runJavaScript("document.body.style.overflow = 'hidden';");
|
||||
//calculate page height
|
||||
_webview.runJavaScript("document.body.scrollHeight;", function (i_actualPageHeight) {
|
||||
if (i_actualPageHeight !== undefined) {
|
||||
flick.contentHeight = i_actualPageHeight
|
||||
} else {
|
||||
flick.contentHeight = flick.height;
|
||||
}
|
||||
})
|
||||
flick.contentWidth = flick.width
|
||||
// _webview.runJavaScript("document.body.style.overflow = 'hidden';");
|
||||
// //calculate page height
|
||||
// _webview.runJavaScript("document.body.scrollHeight;", function (i_actualPageHeight) {
|
||||
// if (i_actualPageHeight !== undefined) {
|
||||
// flick.contentHeight = i_actualPageHeight
|
||||
// } else {
|
||||
// flick.contentHeight = flick.height;
|
||||
// }
|
||||
// })
|
||||
// previousHeight = flick.contentHeight
|
||||
// flick.contentWidth = flick.width
|
||||
// heightTimer.restart()
|
||||
}
|
||||
}
|
||||
|
||||
Timer {
|
||||
id: heightTimer
|
||||
interval: 100
|
||||
repeat: true
|
||||
onTriggered: {
|
||||
// _webview.runJavaScript("document.body.scrollHeight;", function (i_actualPageHeight) {
|
||||
// if (i_actualPageHeight !== undefined) {
|
||||
// var newheight = i_actualPageHeight
|
||||
// if (newheight > 0 && newheight !== previousHeight) {
|
||||
// previousHeight = newheight
|
||||
// flick.contentHeight = previousHeight;
|
||||
// _webview.height = newheight < flick.height ? newheight : flick.height
|
||||
// console.log("new height", previousHeight)
|
||||
// }
|
||||
// }
|
||||
// })
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -84,14 +110,15 @@ Flickable {
|
|||
interval: 100
|
||||
repeat: false
|
||||
onTriggered: {
|
||||
_webview.reload()
|
||||
//_webview.reload()
|
||||
}
|
||||
}
|
||||
|
||||
WebEngineView {
|
||||
id: _webview
|
||||
|
||||
height: parent.height
|
||||
anchors.fill: parent
|
||||
//height: parent.height
|
||||
|
||||
profile: HFWebEngineProfile;
|
||||
|
||||
|
@ -139,10 +166,10 @@ Flickable {
|
|||
grantFeaturePermission(securityOrigin, feature, true);
|
||||
}
|
||||
|
||||
onContentsSizeChanged: {
|
||||
flick.contentHeight = Math.max(contentsSize.height, flick.height);
|
||||
flick.contentWidth = flick.width
|
||||
}
|
||||
// onContentsSizeChanged: {
|
||||
// //flick.contentHeight = Math.max(contentsSize.height, flick.height);
|
||||
// //flick.contentWidth = flick.width
|
||||
// }
|
||||
//disable popup
|
||||
onContextMenuRequested: {
|
||||
request.accepted = true;
|
||||
|
|
|
@ -219,6 +219,8 @@ int main(int argc, const char* argv[]) {
|
|||
// Extend argv to enable WebGL rendering
|
||||
std::vector<const char*> argvExtended(&argv[0], &argv[argc]);
|
||||
argvExtended.push_back("--ignore-gpu-blacklist");
|
||||
argvExtended.push_back("--enable-embedded-switches");
|
||||
argvExtended.push_back("--disable-overlay-scrollbar");
|
||||
int argcExtended = (int)argvExtended.size();
|
||||
|
||||
Application app(argcExtended, const_cast<char**>(argvExtended.data()), startupTime, runningMarkerExisted);
|
||||
|
|
|
@ -367,11 +367,11 @@ void Web3DOverlay::setProxyWindow(QWindow* proxyWindow) {
|
|||
}
|
||||
|
||||
void Web3DOverlay::handlePointerEvent(const PointerEvent& event) {
|
||||
if (_inputMode == Touch) {
|
||||
//if (_inputMode == Touch) {
|
||||
handlePointerEventAsTouch(event);
|
||||
} else {
|
||||
handlePointerEventAsMouse(event);
|
||||
}
|
||||
// } else {
|
||||
// handlePointerEventAsMouse(event);
|
||||
// }
|
||||
}
|
||||
|
||||
void Web3DOverlay::handlePointerEventAsTouch(const PointerEvent& event) {
|
||||
|
|
|
@ -1929,6 +1929,7 @@ var PropertiesTool = function (opts) {
|
|||
data.properties.keyLight.direction.y * DEGREES_TO_RADIANS
|
||||
);
|
||||
}
|
||||
print("data properties " + data.properties)
|
||||
Entities.editEntity(selectionManager.selections[0], data.properties);
|
||||
if (data.properties.name !== undefined || data.properties.modelURL !== undefined ||
|
||||
data.properties.visible !== undefined || data.properties.locked !== undefined) {
|
||||
|
|
Loading…
Reference in a new issue