summaryrefslogtreecommitdiffstats
path: root/demos/declarative/phonebrowser/content/Star.qml
blob: ebcd78b28a236f05489048fcc9acf582bf31f0d0 (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
46
47
Item {
    id: Container
    width: 24
    height: 24

    properties: [
        Property { name: "rating" },
        Property { name: "on" }
    ]

    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"
            }
        }
    ]
}