summaryrefslogtreecommitdiffstats
path: root/demos/declarative/flickr/content/ScrollBar.qml
blob: 2c4ff5473ab0330d2c7188265fbd81a3cd50949b (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
Item {
    id: Container

    property var flickableArea

    Rect {
        radius: 5
        color: "black"
        opacity: 0.3
        pen.color: "white"
        pen.width: 2
        x: 0
        y: flickableArea.pageYPosition * Container.height
        width: parent.width
        height: flickableArea.pageHeight * Container.height
    }
    states: [
        State {
            name: "show"
            when: flickableArea.moving
            SetProperties {
                target: Container
                opacity: 1
            }
        }
    ]
    transitions: [
        Transition {
            fromState: "*"
            toState: "*"
            NumericAnimation {
                target: Container
                properties: "opacity"
                duration: 400
            }
        }
    ]
}