summaryrefslogtreecommitdiffstats
path: root/demos
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2010-02-26 02:01:05 (GMT)
committerMartin Jones <martin.jones@nokia.com>2010-02-26 02:01:05 (GMT)
commit5fb329228bd1cd1126428b045a41a4a9c1033dc5 (patch)
treef93828abe89818729d717d3e9cdae94929f6fb13 /demos
parent3218d437a13ac82f65abcea0db099f54504c8875 (diff)
downloadQt-5fb329228bd1cd1126428b045a41a4a9c1033dc5.zip
Qt-5fb329228bd1cd1126428b045a41a4a9c1033dc5.tar.gz
Qt-5fb329228bd1cd1126428b045a41a4a9c1033dc5.tar.bz2
Renamed Flickable viewportXXX properties contentXXX
A viewport is the thing you look through, not what you look at.
Diffstat (limited to 'demos')
-rw-r--r--demos/declarative/flickr/common/ImageDetails.qml12
-rw-r--r--demos/declarative/flickr/mobile/ImageDetails.qml10
-rw-r--r--demos/declarative/webbrowser/content/FlickableWebView.qml22
-rw-r--r--demos/declarative/webbrowser/content/RetractingWebBrowserHeader.qml8
-rw-r--r--demos/declarative/webbrowser/webbrowser.qml8
5 files changed, 30 insertions, 30 deletions
diff --git a/demos/declarative/flickr/common/ImageDetails.qml b/demos/declarative/flickr/common/ImageDetails.qml
index ab94d7a..f91b365 100644
--- a/demos/declarative/flickr/common/ImageDetails.qml
+++ b/demos/declarative/flickr/common/ImageDetails.qml
@@ -50,7 +50,7 @@ Flipable {
LikeOMeter { x: 40; y: 250; rating: container.rating }
Flickable { id: flickable; x: 220; width: 480; height: 210; y: 130; clip: true
- viewportWidth: 480; viewportHeight: descriptionText.height
+ contentWidth: 480; contentHeight: descriptionText.height
WebView { id: descriptionText; width: parent.width
html: "<style TYPE=\"text/css\">body {color: white;} a:link {color: cyan; text-decoration: underline; }</style>" + container.photoDescription }
@@ -84,7 +84,7 @@ Flipable {
Flickable {
id: flick; width: container.width - 10; height: container.height - 10
x: 5; y: 5; clip: true;
- viewportWidth: imageContainer.width; viewportHeight: imageContainer.height
+ contentWidth: imageContainer.width; contentHeight: imageContainer.height
Item {
id: imageContainer
@@ -122,12 +122,12 @@ Flipable {
id: slider; x: 25; y: 374; visible: { bigImage.status == 1 && maximum > minimum }
onValueChanged: {
if (bigImage.width * value > flick.width) {
- var xoff = (flick.width/2 + flick.viewportX) * value / prevScale;
- flick.viewportX = xoff - flick.width/2;
+ var xoff = (flick.width/2 + flick.contentX) * value / prevScale;
+ flick.contentX = xoff - flick.width/2;
}
if (bigImage.height * value > flick.height) {
- var yoff = (flick.height/2 + flick.viewportY) * value / prevScale;
- flick.viewportY = yoff - flick.height/2;
+ var yoff = (flick.height/2 + flick.contentY) * value / prevScale;
+ flick.contentY = yoff - flick.height/2;
}
prevScale = value;
}
diff --git a/demos/declarative/flickr/mobile/ImageDetails.qml b/demos/declarative/flickr/mobile/ImageDetails.qml
index 415764e..8749b4c 100644
--- a/demos/declarative/flickr/mobile/ImageDetails.qml
+++ b/demos/declarative/flickr/mobile/ImageDetails.qml
@@ -57,7 +57,7 @@ Flipable {
Common.Progress { anchors.centerIn: parent; width: 200; height: 18; progress: bigImage.progress; visible: bigImage.status!=1 }
Flickable {
id: flickable; anchors.fill: parent; clip: true
- viewportWidth: imageContainer.width; viewportHeight: imageContainer.height
+ contentWidth: imageContainer.width; contentHeight: imageContainer.height
Item {
id: imageContainer
@@ -97,12 +97,12 @@ Flipable {
}
onValueChanged: {
if (bigImage.width * value > flickable.width) {
- var xoff = (flickable.width/2 + flickable.viewportX) * value / prevScale;
- flickable.viewportX = xoff - flickable.width/2;
+ var xoff = (flickable.width/2 + flickable.contentX) * value / prevScale;
+ flickable.contentX = xoff - flickable.width/2;
}
if (bigImage.height * value > flickable.height) {
- var yoff = (flickable.height/2 + flickable.viewportY) * value / prevScale;
- flickable.viewportY = yoff - flickable.height/2;
+ var yoff = (flickable.height/2 + flickable.contentY) * value / prevScale;
+ flickable.contentY = yoff - flickable.height/2;
}
prevScale = value;
}
diff --git a/demos/declarative/webbrowser/content/FlickableWebView.qml b/demos/declarative/webbrowser/content/FlickableWebView.qml
index b60a95f..e686d02 100644
--- a/demos/declarative/webbrowser/content/FlickableWebView.qml
+++ b/demos/declarative/webbrowser/content/FlickableWebView.qml
@@ -10,8 +10,8 @@ Flickable {
id: flickable
width: parent.width
- viewportWidth: Math.max(parent.width,webView.width*webView.scale)
- viewportHeight: Math.max(parent.height,webView.height*webView.scale)
+ contentWidth: Math.max(parent.width,webView.width*webView.scale)
+ contentHeight: Math.max(parent.height,webView.height*webView.scale)
anchors.top: headerSpace.bottom
anchors.bottom: footer.top
anchors.left: parent.left
@@ -53,10 +53,10 @@ Flickable {
if (centerX) {
var sc = zoom/contentsScale;
scaleAnim.to = sc;
- flickVX.from = flickable.viewportX
+ 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.viewportY
+ 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
@@ -76,8 +76,8 @@ Flickable {
}
onUrlChanged: {
// got to topleft
- flickable.viewportX = 0
- flickable.viewportY = 0
+ flickable.contentX = 0
+ flickable.contentY = 0
if (url != null) { header.editUrl = url.toString(); }
}
onDoubleClick: {
@@ -110,7 +110,7 @@ Flickable {
NumberAnimation {
id: flickVX
target: flickable
- property: "viewportX"
+ property: "contentX"
easing.type: "Linear"
duration: 200
from: 0 // set before calling
@@ -119,7 +119,7 @@ Flickable {
NumberAnimation {
id: flickVY
target: flickable
- property: "viewportY"
+ property: "contentY"
easing.type: "Linear"
duration: 200
from: 0 // set before calling
@@ -136,19 +136,19 @@ Flickable {
property: "scale"
value: 1.0
}
- // Have to set the viewportXY, since the above 2
+ // Have to set the contentXY, since the above 2
// size changes may have started a correction if
// contentsScale < 1.0.
PropertyAction {
id: finalX
target: flickable
- property: "viewportX"
+ property: "contentX"
value: 0 // set before calling
}
PropertyAction {
id: finalY
target: flickable
- property: "viewportY"
+ property: "contentY"
value: 0 // set before calling
}
PropertyAction {
diff --git a/demos/declarative/webbrowser/content/RetractingWebBrowserHeader.qml b/demos/declarative/webbrowser/content/RetractingWebBrowserHeader.qml
index f905150..e8c9208 100644
--- a/demos/declarative/webbrowser/content/RetractingWebBrowserHeader.qml
+++ b/demos/declarative/webbrowser/content/RetractingWebBrowserHeader.qml
@@ -9,10 +9,10 @@ Image {
source: "pics/header.png"
width: parent.width
height: 60
- x: webView.viewportX < 0 ? -webView.viewportX : webView.viewportX > webView.viewportWidth-webView.width
- ? -webView.viewportX+webView.viewportWidth-webView.width : 0
- y: webView.viewportY < 0 ? -webView.viewportY : progressOff*
- (webView.viewportY>height?-height:-webView.viewportY)
+ x: webView.contentX < 0 ? -webView.contentX : webView.contentX > webView.contentWidth-webView.width
+ ? -webView.contentX+webView.contentWidth-webView.width : 0
+ y: webView.contentY < 0 ? -webView.contentY : progressOff*
+ (webView.contentY>height?-height:-webView.contentY)
Text {
id: headerText
diff --git a/demos/declarative/webbrowser/webbrowser.qml b/demos/declarative/webbrowser/webbrowser.qml
index faafd5d..6a427f4 100644
--- a/demos/declarative/webbrowser/webbrowser.qml
+++ b/demos/declarative/webbrowser/webbrowser.qml
@@ -30,10 +30,10 @@ Item {
anchors.bottom: footer.top
}
RectSoftShadow {
- x: -webView.viewportX
- y: -webView.viewportY
- width: webView.viewportWidth
- height: webView.viewportHeight+headerSpace.height
+ x: -webView.contentX
+ y: -webView.contentY
+ width: webView.contentWidth
+ height: webView.contentHeight+headerSpace.height
}
Item {
id: headerSpace