summaryrefslogtreecommitdiffstats
path: root/demos/declarative/flickr/content/Star.qml
blob: 2c2807a851b29ff6825185b5254f7b6ae8bebcf3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
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() }
    }
    states: [
        State {
            name: "on"
            when: Container.on == true
            SetProperties {
                target: Image
                opacity: 1
                scale: 1
                x: 1
                y: 0
            }
        }
    ]
    transitions: [
        Transition {
            NumberAnimation {
                properties: "opacity,scale,x,y"
                easing: "easeOutBounce"
            }
        }
    ]
}