summaryrefslogtreecommitdiffstats
path: root/demos/declarative/flickr/common/ScrollBar.qml
blob: 4022d235853d35d5f78f8a8a5fb3604849fc3e2e (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
import Qt 4.7

Item {
    id: container

    property variant flickableArea

    Rectangle {
        radius: 5
        color: "black"
        opacity: 0.3
        border.color: "white"
        border.width: 2
        x: 0
        y: flickableArea.visibleArea.yPosition * container.height
        width: parent.width
        height: flickableArea.visibleArea.heightRatio * container.height
    }
    states: [
        State {
            name: "show"
            when: flickableArea.moving
            PropertyChanges {
                target: container
                opacity: 1
            }
        }
    ]
    transitions: [
        Transition {
            from: "*"
            to: "*"
            NumberAnimation {
                target: container
                properties: "opacity"
                duration: 400
            }
        }
    ]
}