diff options
author | Bea Lam <bea.lam@nokia.com> | 2009-10-08 05:08:40 (GMT) |
---|---|---|
committer | Bea Lam <bea.lam@nokia.com> | 2009-10-08 05:08:40 (GMT) |
commit | f149107f3281fd537c98aaac5cba5934d55aa78a (patch) | |
tree | 57bd2008434dbaeb857b29e4ec3f1c99c45139d3 /examples/declarative/layouts/Button.qml | |
parent | e79cf93c8b724c8eac042e68ba8dee0b9f2feee3 (diff) | |
download | Qt-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.qml | 27 |
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 } } } |