summaryrefslogtreecommitdiffstats
path: root/demos/declarative/flickr/content/Star.qml
diff options
context:
space:
mode:
Diffstat (limited to 'demos/declarative/flickr/content/Star.qml')
-rw-r--r--demos/declarative/flickr/content/Star.qml44
1 files changed, 44 insertions, 0 deletions
diff --git a/demos/declarative/flickr/content/Star.qml b/demos/declarative/flickr/content/Star.qml
new file mode 100644
index 0000000..22fc138
--- /dev/null
+++ b/demos/declarative/flickr/content/Star.qml
@@ -0,0 +1,44 @@
+Item {
+ id: Container
+ width: 24
+ height: 24
+
+ property string rating
+ property string on
+
+ signal clicked
+
+ Image {
+ id: Image
+ source: "pics/ghns_star.png"
+ x: 6
+ y: 7
+ opacity: 0.4
+ scale: 0.5
+ }
+ MouseRegion {
+ anchors.fill: Container
+ onClicked: { Container.clicked.emit() }
+ }
+ states: [
+ State {
+ name: "on"
+ when: Container.on == true
+ SetProperties {
+ target: Image
+ opacity: 1
+ scale: 1
+ x: 1
+ y: 0
+ }
+ }
+ ]
+ transitions: [
+ Transition {
+ NumericAnimation {
+ properties: "opacity,scale,x,y"
+ easing: "easeOutBounce"
+ }
+ }
+ ]
+}