summaryrefslogtreecommitdiffstats
path: root/demos/declarative/phonebrowser/content/Star.qml
blob: d53c52923b9b5802e2012e80d6a3659c05da66a3 (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
45
Item {
    property var rating
    property var on

    id: Container
    width: 24
    height: 24

    signals: Signal {
        name: "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"
            }
        }
    ]
}