diff options
author | Yann Bodson <yann.bodson@nokia.com> | 2009-10-30 03:36:19 (GMT) |
---|---|---|
committer | Yann Bodson <yann.bodson@nokia.com> | 2009-10-30 03:36:19 (GMT) |
commit | f37e9d787bd418d8f75997a8d46c1c42e842c673 (patch) | |
tree | 8e11076675fa02740d5d5ca490b5dc09adc16bdf /examples/declarative/dynamic/qml/Button.qml | |
parent | 72932c6683729071c1acb3f4832c5dc53a561bdd (diff) | |
download | Qt-f37e9d787bd418d8f75997a8d46c1c42e842c673.zip Qt-f37e9d787bd418d8f75997a8d46c1c42e842c673.tar.gz Qt-f37e9d787bd418d8f75997a8d46c1c42e842c673.tar.bz2 |
cleanup
Diffstat (limited to 'examples/declarative/dynamic/qml/Button.qml')
-rw-r--r-- | examples/declarative/dynamic/qml/Button.qml | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/examples/declarative/dynamic/qml/Button.qml b/examples/declarative/dynamic/qml/Button.qml new file mode 100644 index 0000000..2769cd8 --- /dev/null +++ b/examples/declarative/dynamic/qml/Button.qml @@ -0,0 +1,24 @@ +import Qt 4.6 + +Rectangle { + id: container + + property var text + signal clicked + + SystemPalette { id: activePalette; colorGroup: Qt.Active } + height: text.height + 10 + width: text.width + 20 + border.width: 1 + radius: 4; smooth: true + gradient: Gradient { + GradientStop { position: 0.0; + color: if(!mr.pressed){activePalette.light;}else{activePalette.button;} + } + GradientStop { position: 1.0; + color: if(!mr.pressed){activePalette.button;}else{activePalette.dark;} + } + } + MouseRegion { id:mr; anchors.fill: parent; onClicked: container.clicked() } + Text { id: text; anchors.centerIn:parent; font.pointSize: 10; text: parent.text; color: activePalette.buttonText } +} |