summaryrefslogtreecommitdiffstats
path: root/demos/declarative/flickr/common/ScrollBar.qml
diff options
context:
space:
mode:
Diffstat (limited to 'demos/declarative/flickr/common/ScrollBar.qml')
-rw-r--r--demos/declarative/flickr/common/ScrollBar.qml40
1 files changed, 40 insertions, 0 deletions
diff --git a/demos/declarative/flickr/common/ScrollBar.qml b/demos/declarative/flickr/common/ScrollBar.qml
new file mode 100644
index 0000000..2c1ec8a
--- /dev/null
+++ b/demos/declarative/flickr/common/ScrollBar.qml
@@ -0,0 +1,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
+ matchProperties: "opacity"
+ duration: 400
+ }
+ }
+ ]
+}