summaryrefslogtreecommitdiffstats
path: root/examples/declarative/snow/snow.qml
diff options
context:
space:
mode:
authorBea Lam <bea.lam@nokia.com>2010-03-02 02:08:54 (GMT)
committerBea Lam <bea.lam@nokia.com>2010-03-02 02:08:54 (GMT)
commitb3c94b923200dd9c98b66f4233c62e63a3ee79d4 (patch)
tree4181b0f4e3feb993d9eeae16c0dd1ccf5daa5bc3 /examples/declarative/snow/snow.qml
parent8da93faace82eb2bc86e76c0ad0a0c5c95e3b8bf (diff)
parenta9d327db7e77cc167172ad3199b6ffbc1c9da74f (diff)
downloadQt-b3c94b923200dd9c98b66f4233c62e63a3ee79d4.zip
Qt-b3c94b923200dd9c98b66f4233c62e63a3ee79d4.tar.gz
Qt-b3c94b923200dd9c98b66f4233c62e63a3ee79d4.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7
Diffstat (limited to 'examples/declarative/snow/snow.qml')
-rw-r--r--examples/declarative/snow/snow.qml69
1 files changed, 0 insertions, 69 deletions
diff --git a/examples/declarative/snow/snow.qml b/examples/declarative/snow/snow.qml
deleted file mode 100644
index 39c9c43..0000000
--- a/examples/declarative/snow/snow.qml
+++ /dev/null
@@ -1,69 +0,0 @@
-import Qt 4.6
-
-Rectangle {
- id: imagePanel
- width: 1024
- height: 768
- color: "black"
-
- property int maximumColumn: 4
- property int selectedItemRow: 0
- property int selectedItemColumn: 0
-
- Script { source: "create.js" }
-
- onSelectedItemColumnChanged: if (selectedItemColumn == maximumColumn) createNewBlock();
-
- property int imageWidth: 200
- property int imageHeight: 200
-
- property int selectedX: selectedItemColumn * imageWidth
- property int selectedY: selectedItemRow * imageHeight
-
- Item {
- anchors.centerIn: parent
- Row {
- id: layout
- property real targetX: -(selectedX + imageWidth / 2)
-
- property real targetDeform: 0
- property bool slowDeform: true
-
- property real deform: 0
- deform: SpringFollow {
- id: deformFollow; source: layout.targetDeform; velocity: layout.slowDeform?0.1:2
- onSyncChanged: if(inSync) { layout.slowDeform = true; layout.targetDeform = 0; }
- }
-
- ImageBatch { offset: 0; ref: imagePanel }
-
- x: SpringFollow { source: layout.targetX; velocity: 1000 }
- y: SpringFollow { source: -(selectedY + imageHeight / 2); velocity: 500 }
- }
-
- transform: Rotation {
- axis.y: 1; axis.z: 0
- angle: layout.deform * -100
- }
- }
-
- Script {
- function left() {
- if (selectedItemColumn <= 0) return;
- selectedItemColumn -= 1;
- layout.slowDeform = false;
- layout.targetDeform = Math.max(Math.min(layout.deform - 0.1, -0.1), -0.4);
- }
- function right() {
- selectedItemColumn += 1;
- layout.slowDeform = false;
- layout.targetDeform = Math.min(Math.max(layout.deform + 0.1, 0.1), 0.4);
- }
- }
-
- focus: true
- Keys.onLeftPressed: "left()"
- Keys.onRightPressed: "right()"
- Keys.onUpPressed: "if (selectedItemRow > 0) selectedItemRow = selectedItemRow - 1"
- Keys.onDownPressed: "if (selectedItemRow < 3) selectedItemRow = selectedItemRow + 1"
-}