diff --git a/interface/resources/qml/controls/FlickableWebViewCore.qml b/interface/resources/qml/controls/FlickableWebViewCore.qml index 13a435c4e5..55be37883c 100644 --- a/interface/resources/qml/controls/FlickableWebViewCore.qml +++ b/interface/resources/qml/controls/FlickableWebViewCore.qml @@ -6,7 +6,7 @@ import QtQuick.Controls 2.2 import "../styles-uit" as StylesUIt -Flickable { +Item { id: flick property alias url: _webview.url @@ -19,38 +19,15 @@ Flickable { signal newViewRequestedCallback(var request) signal loadingChangedCallback(var loadRequest) - pressDelay: 300 - boundsBehavior: Flickable.StopAtBounds + property bool interactive: false StylesUIt.HifiConstants { id: hifi } - 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 - visible: flick.contentHeight > flick.height - - contentItem: Rectangle { - opacity: 0.75 - implicitWidth: hifi.dimensions.scrollbarHandleWidth - radius: height / 2 - color: hifi.colors.tableScrollHandleDark - } - } - function onLoadingChanged(loadRequest) { if (WebEngineView.LoadStartedStatus === loadRequest.status) { - flick.contentWidth = flick.width - flick.contentHeight = flick.height // Required to support clicking on "hifi://" links var url = loadRequest.url.toString(); @@ -67,32 +44,13 @@ Flickable { 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 - } - } - - Timer { - id: reloadTimer - interval: 100 - repeat: false - onTriggered: { - _webview.reload() } } WebEngineView { id: _webview - height: parent.height + anchors.fill: parent profile: HFWebEngineProfile; @@ -125,7 +83,6 @@ Flickable { property string newUrl: "" Component.onCompleted: { - width = Qt.binding(function() { return flick.width; }); webChannel.registerObject("eventBridge", eventBridge); webChannel.registerObject("eventBridgeWrapper", eventBridgeWrapper); // Ensure the JS from the web-engine makes it to our logging @@ -140,10 +97,6 @@ Flickable { grantFeaturePermission(securityOrigin, feature, true); } - onContentsSizeChanged: { - flick.contentHeight = Math.max(contentsSize.height, flick.height); - flick.contentWidth = flick.width - } //disable popup onContextMenuRequested: { request.accepted = true; @@ -168,11 +121,4 @@ Flickable { playing: visible z: 10000 } - - MouseArea { - anchors.fill: parent - onWheel: { - flick.flick(0, wheel.angleDelta.y*10) - } - } }