summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorJoona Petrell <joona.t.petrell@nokia.com>2010-09-21 07:32:22 (GMT)
committerJoona Petrell <joona.t.petrell@nokia.com>2010-09-21 07:32:36 (GMT)
commit37ba2e1140c62ac0123479b3d1a7f2638f095e20 (patch)
tree72d7b47683655577875a1fdb23b81deb0e9017f9 /examples
parent8b97765d6e7cf207fb3a5ea8ac4fc5adbbcd3610 (diff)
downloadQt-37ba2e1140c62ac0123479b3d1a7f2638f095e20.zip
Qt-37ba2e1140c62ac0123479b3d1a7f2638f095e20.tar.gz
Qt-37ba2e1140c62ac0123479b3d1a7f2638f095e20.tar.bz2
Fix corkboards example for smaller screens
Task-number: Reviewed-by: Martin Jones
Diffstat (limited to 'examples')
-rw-r--r--examples/declarative/toys/corkboards/Day.qml15
1 files changed, 11 insertions, 4 deletions
diff --git a/examples/declarative/toys/corkboards/Day.qml b/examples/declarative/toys/corkboards/Day.qml
index f406f7b..3525a5b 100644
--- a/examples/declarative/toys/corkboards/Day.qml
+++ b/examples/declarative/toys/corkboards/Day.qml
@@ -45,9 +45,16 @@ Component {
property variant stickies
id: page
- width: 840; height: 480
+ width: ListView.view.width+40; height: ListView.view.height
- Image { source: "cork.jpg" }
+
+ Image {
+ source: "cork.jpg"
+ width: page.ListView.view.width
+ height: page.ListView.view.height
+ fillMode: Image.PreserveAspectCrop
+ clip: true
+ }
MouseArea {
anchors.fill: parent
@@ -65,8 +72,8 @@ Component {
Item {
id: stickyPage
- property int randomX: Math.random() * 500 + 100
- property int randomY: Math.random() * 200 + 50
+ property int randomX: Math.random() * (page.ListView.view.width-0.5*stickyImage.width) +100
+ property int randomY: Math.random() * (page.ListView.view.height-0.5*stickyImage.height) +50
x: randomX; y: randomY