summaryrefslogtreecommitdiffstats
path: root/demos/declarative/flickr/common/ScrollBar.qml
blob: d31c57ceae1bf88591376020cc451b1bf9580012 (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.6

Item {
    id: Container

    property var 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
            }
        }
    ]
}