aboutsummaryrefslogtreecommitdiffstats
path: root/examples/qml/dynamicscene/dynamicscene.qml
diff options
context:
space:
mode:
authorAlan Alpert <alan.alpert@nokia.com>2012-03-27 18:00:33 +1000
committerQt by Nokia <qt-info@nokia.com>2012-03-28 05:49:28 +0200
commita3d4c97c5fb28599e007116fec679b16656df512 (patch)
tree811ae05f13d2b90dce878346ae2452dcf6b3934d /examples/qml/dynamicscene/dynamicscene.qml
parented37dd9bb1f63d47a5daafc06af3a13549000f0c (diff)
Reduce assumptions in examples
-dynamic scene, don't set duration on running animation (doesn't work) -dynamic scene, just use set colors instead of system palette (in case platform doesn't support it right, like N900) -dynamic scene, calculator and shadereffects, don't rely on root item being automatically in scope (possibly confusing) Change-Id: I1eec018d5387424dc6b07bf51c1b2184b3048553 Reviewed-by: Yann Bodson <yann.bodson@nokia.com>
Diffstat (limited to 'examples/qml/dynamicscene/dynamicscene.qml')
-rw-r--r--examples/qml/dynamicscene/dynamicscene.qml19
1 files changed, 8 insertions, 11 deletions
diff --git a/examples/qml/dynamicscene/dynamicscene.qml b/examples/qml/dynamicscene/dynamicscene.qml
index c64df5cfc0..66521b8caa 100644
--- a/examples/qml/dynamicscene/dynamicscene.qml
+++ b/examples/qml/dynamicscene/dynamicscene.qml
@@ -95,7 +95,7 @@ Item {
// sky
Rectangle {
id: sky
- anchors { left: parent.left; top: toolbox.bottom; right: parent.right; bottomMargin: -centerOffset; bottom: parent.verticalCenter }
+ anchors { left: parent.left; top: toolbox.bottom; right: parent.right; bottomMargin: -window.centerOffset; bottom: parent.verticalCenter }
gradient: Gradient {
GradientStop { id: gradientStopA; position: 0.0; color: "#0E1533" }
GradientStop { id: gradientStopB; position: 1.0; color: "#437284" }
@@ -127,21 +127,19 @@ Item {
Rectangle {
id: ground
z: 2 // just above the sun so that the sun can set behind it
- anchors { left: parent.left; top: parent.verticalCenter; topMargin: centerOffset; right: parent.right; bottom: parent.bottom }
+ anchors { left: parent.left; top: parent.verticalCenter; topMargin: window.centerOffset; right: parent.right; bottom: parent.bottom }
gradient: Gradient {
GradientStop { position: 0.0; color: "ForestGreen" }
GradientStop { position: 1.0; color: "DarkGreen" }
}
}
- SystemPalette { id: activePalette }
-
- // right-hand panel
+ // top panel
Rectangle {
id: toolbox
- height: centerOffset * 2
- color: activePalette.window
+ height: window.centerOffset * 2
+ color: "white"
anchors { right: parent.right; top: parent.top; left: parent.left}
Column {
@@ -192,7 +190,7 @@ Item {
}
}
- Text { text: "Active Suns: " + activeSuns }
+ Text { text: "Active Suns: " + window.activeSuns }
}
}
@@ -202,7 +200,7 @@ Item {
z: 1000
width: parent.width
height: popupColumn.height + 16
- color: activePalette.window
+ color: "white"
property bool poppedUp: false
property int downY: window.height - (createButton.height + 16)
@@ -213,7 +211,6 @@ Item {
Column {
id: popupColumn
y: 8
- anchors.centerIn: parent
spacing: 8
Row {
@@ -250,7 +247,7 @@ Item {
selectByMouse: true
wrapMode: TextEdit.WordWrap
- text: "import QtQuick 2.0\nImage {\n id: smile\n x: 360 * Math.random()\n y: 180 * Math.random() \n source: 'content/images/face-smile.png'\n NumberAnimation on opacity { \n to: 0; duration: 1500\n }\n Component.onCompleted: smile.destroy(1500);\n}"
+ text: "import QtQuick 2.0\nImage {\n id: smile\n x: 360 * Math.random()\n y: 40 * Math.random() \n source: 'content/images/face-smile.png'\n NumberAnimation on opacity { \n to: 0; duration: 1500\n }\n Component.onCompleted: smile.destroy(1500);\n}"
}
}
}