summaryrefslogtreecommitdiffstats
path: root/demos/declarative/mediabrowser/content/MediaButton.qml
diff options
context:
space:
mode:
Diffstat (limited to 'demos/declarative/mediabrowser/content/MediaButton.qml')
-rw-r--r--demos/declarative/mediabrowser/content/MediaButton.qml21
1 files changed, 21 insertions, 0 deletions
diff --git a/demos/declarative/mediabrowser/content/MediaButton.qml b/demos/declarative/mediabrowser/content/MediaButton.qml
new file mode 100644
index 0000000..c92305a
--- /dev/null
+++ b/demos/declarative/mediabrowser/content/MediaButton.qml
@@ -0,0 +1,21 @@
+<Item id="Container">
+ <signals>
+ <Signal name="clicked"/>
+ </signals>
+
+ <properties>
+ <Property name="text"/>
+ </properties>
+
+ <Image id="Image" src="pics/button.png"/>
+ <Image id="Pressed" src="pics/button-pressed.png" opacity="0"/>
+ <MouseRegion id="MouseRegion" anchors.fill="{Image}" onClicked="Container.clicked.emit();"/>
+ <Text font.bold="true" color="white" anchors.centeredIn="{Image}" text="{Container.text}"/>
+ <width>{Image.width}</width>
+
+ <states>
+ <State name="Pressed" when="{MouseRegion.pressed == true}">
+ <SetProperties target="{Pressed}" opacity="1"/>
+ </State>
+ </states>
+</Item>