summaryrefslogtreecommitdiffstats
path: root/weather-qml/ScrollBar.qml
diff options
context:
space:
mode:
Diffstat (limited to 'weather-qml/ScrollBar.qml')
-rw-r--r--weather-qml/ScrollBar.qml27
1 files changed, 27 insertions, 0 deletions
diff --git a/weather-qml/ScrollBar.qml b/weather-qml/ScrollBar.qml
new file mode 100644
index 0000000..2361c32
--- /dev/null
+++ b/weather-qml/ScrollBar.qml
@@ -0,0 +1,27 @@
+import Qt 4.6
+
+Item {
+ id: scrollBar
+
+ property real position
+ property real pageSize
+
+ Rectangle {
+ id: background
+ anchors.fill: parent
+ opacity: 0.3
+ color: "white"
+ radius: (width / 2 - 1)
+ }
+
+ Rectangle {
+ opacity: 0.7
+ color: "black"
+ radius: (width / 2 - 1)
+ x: 1
+ y: Math.min(Math.max(0.0, scrollBar.position),
+ Math.max(0.0, 1.0 - scrollBar.pageSize)) * (scrollBar.height - 2) + 1
+ width: parent.width - 2
+ height: Math.min(1.0, scrollBar.pageSize) * (scrollBar.height - 2)
+ }
+}