summaryrefslogtreecommitdiffstats
path: root/demos/declarative/flickr/mobile/Button.qml
diff options
context:
space:
mode:
authorYann Bodson <yann.bodson@nokia.com>2009-08-25 01:20:08 (GMT)
committerYann Bodson <yann.bodson@nokia.com>2009-08-25 01:20:08 (GMT)
commit7f41d39c293e1bd013acc0e79af2aa66e1f9e4d0 (patch)
tree01569d474f4eee0a097fdb4a5be8b39a09399f52 /demos/declarative/flickr/mobile/Button.qml
parente1081c88616fea20fed343e258c98da2a669d9f1 (diff)
downloadQt-7f41d39c293e1bd013acc0e79af2aa66e1f9e4d0.zip
Qt-7f41d39c293e1bd013acc0e79af2aa66e1f9e4d0.tar.gz
Qt-7f41d39c293e1bd013acc0e79af2aa66e1f9e4d0.tar.bz2
Mobile version of Flickr demo in flickr-mobile.qml.
Diffstat (limited to 'demos/declarative/flickr/mobile/Button.qml')
-rw-r--r--demos/declarative/flickr/mobile/Button.qml41
1 files changed, 41 insertions, 0 deletions
diff --git a/demos/declarative/flickr/mobile/Button.qml b/demos/declarative/flickr/mobile/Button.qml
new file mode 100644
index 0000000..275408c
--- /dev/null
+++ b/demos/declarative/flickr/mobile/Button.qml
@@ -0,0 +1,41 @@
+import Qt 4.6
+
+Item {
+ id: Container
+
+ signal clicked
+
+ property string text
+
+ BorderImage {
+ id: Image
+ source: "images/toolbutton2.sci"
+ width: Container.width; height: Container.height
+ }
+ BorderImage {
+ id: Pressed
+ opacity: 0
+ source: "images/toolbutton2.sci"
+ width: Container.width; height: Container.height
+ }
+ MouseRegion {
+ id: MouseRegion
+ anchors.fill: Image
+ onClicked: { Container.clicked(); }
+ }
+ Text {
+ color: "white"
+ anchors.centerIn: Image; font.bold: true
+ text: Container.text; style: "Raised"; styleColor: "black"
+ }
+ states: [
+ State {
+ name: "Pressed"
+ when: MouseRegion.pressed == true
+ PropertyChanges {
+ target: Pressed
+ opacity: 1
+ }
+ }
+ ]
+}