diff options
Diffstat (limited to 'demos/declarative/webbrowser')
-rw-r--r-- | demos/declarative/webbrowser/content/FlickableWebView.qml | 29 |
1 files changed, 7 insertions, 22 deletions
diff --git a/demos/declarative/webbrowser/content/FlickableWebView.qml b/demos/declarative/webbrowser/content/FlickableWebView.qml index 7efbaa3..32d69d8 100644 --- a/demos/declarative/webbrowser/content/FlickableWebView.qml +++ b/demos/declarative/webbrowser/content/FlickableWebView.qml @@ -12,8 +12,8 @@ Flickable { id: flickable width: parent.width - contentWidth: Math.max(parent.width,webView.width*webView.scale) - contentHeight: Math.max(parent.height,webView.height*webView.scale) + contentWidth: Math.max(parent.width,webView.width) + contentHeight: Math.max(parent.height,webView.height) anchors.top: headerSpace.bottom anchors.bottom: parent.top anchors.left: parent.left @@ -28,7 +28,6 @@ Flickable { WebView { id: webView - pixelCacheSize: 4000000 transformOrigin: Item.TopLeft function fixUrl(url) @@ -48,8 +47,6 @@ Flickable { url: fixUrl(webBrowser.urlString) smooth: false // We don't want smooth scaling, since we only scale during (fast) transitions - smoothCache: true // We do want smooth rendering - fillColor: "white" focus: true zoomFactor: 1 @@ -59,14 +56,13 @@ Flickable { { if (centerX) { var sc = zoom/contentsScale; - scaleAnim.to = sc; + scaleAnim.to = zoom; flickVX.from = flickable.contentX flickVX.to = Math.max(0,Math.min(centerX-flickable.width/2,webView.width*sc-flickable.width)) finalX.value = flickVX.to flickVY.from = flickable.contentY flickVY.to = Math.max(0,Math.min(centerY-flickable.height/2,webView.height*sc-flickable.height)) finalY.value = flickVY.to - finalZoom.value = zoom quickZoom.start() } } @@ -74,8 +70,8 @@ Flickable { Keys.onLeftPressed: webView.contentsScale -= 0.1 Keys.onRightPressed: webView.contentsScale += 0.1 - preferredWidth: flickable.width*zoomFactor - preferredHeight: flickable.height*zoomFactor + preferredWidth: flickable.width + preferredHeight: flickable.height contentsScale: 1/zoomFactor onContentsSizeChanged: { // zoom out @@ -108,9 +104,8 @@ Flickable { NumberAnimation { id: scaleAnim target: webView - property: "scale" - from: 1 - to: 0 // set before calling + property: "contentsScale" + // the to property is set before calling easing.type: Easing.Linear duration: 200 } @@ -133,16 +128,6 @@ Flickable { to: 0 // set before calling } } - PropertyAction { - id: finalZoom - target: webView - property: "contentsScale" - } - PropertyAction { - target: webView - property: "scale" - value: 1.0 - } // Have to set the contentXY, since the above 2 // size changes may have started a correction if // contentsScale < 1.0. |