summaryrefslogtreecommitdiffstats
path: root/examples/declarative/layouts/Button.qml
diff options
context:
space:
mode:
authorBea Lam <bea.lam@nokia.com>2009-10-08 05:08:40 (GMT)
committerBea Lam <bea.lam@nokia.com>2009-10-08 05:08:40 (GMT)
commitf149107f3281fd537c98aaac5cba5934d55aa78a (patch)
tree57bd2008434dbaeb857b29e4ec3f1c99c45139d3 /examples/declarative/layouts/Button.qml
parente79cf93c8b724c8eac042e68ba8dee0b9f2feee3 (diff)
downloadQt-f149107f3281fd537c98aaac5cba5934d55aa78a.zip
Qt-f149107f3281fd537c98aaac5cba5934d55aa78a.tar.gz
Qt-f149107f3281fd537c98aaac5cba5934d55aa78a.tar.bz2
Clean up
Diffstat (limited to 'examples/declarative/layouts/Button.qml')
-rw-r--r--examples/declarative/layouts/Button.qml27
1 files changed, 21 insertions, 6 deletions
diff --git a/examples/declarative/layouts/Button.qml b/examples/declarative/layouts/Button.qml
index 6c2fd8d..186512b 100644
--- a/examples/declarative/layouts/Button.qml
+++ b/examples/declarative/layouts/Button.qml
@@ -1,20 +1,35 @@
import Qt 4.6
-Rectangle { border.color: "black"; color: "steelblue"; radius: 5; width: pix.width + text.width + 13; height: pix.height + 10; id: page
+Rectangle {
+ id: page
+ border.color: "black"
+ color: "steelblue"
+ radius: 5
+ width: pix.width + text.width + 13
+ height: pix.height + 10
+
property string text
property string icon
signal clicked
+
Image { id: pix; x: 5; y:5; source: parent.icon}
+
Text { id: text; text: page.text; color: "white"; x:pix.width+pix.x+3; anchors.verticalCenter: pix.verticalCenter;}
- MouseRegion{ id:mr; anchors.fill: parent; onClicked: {parent.focus = true; page.clicked()}}
+
+ MouseRegion {
+ id: mr
+ anchors.fill: parent
+ onClicked: { parent.focus = true; page.clicked() }
+ }
states:
- State{ name:"pressed"; when:mr.pressed
- PropertyChanges {target:text; x: 5}
- PropertyChanges {target:pix; x:text.x+text.width + 3}
+ State {
+ name: "pressed"; when: mr.pressed
+ PropertyChanges { target:text; x: 5 }
+ PropertyChanges { target:pix; x:text.x+text.width + 3 }
}
transitions:
Transition{
- NumberAnimation{ properties:"x,left"; easing:"easeInOutQuad"; duration:200 }
+ NumberAnimation { properties:"x,left"; easing:"easeInOutQuad"; duration:200 }
}
}