5
// The properties that define the scrollbar's state.
6
// position and pageSize are in the range 0.0 - 1.0. They are relative to the
7
// height of the page, i.e. a pageSize of 0.5 means that you can see 50%
8
// of the height of the view.
9
// orientation can be either 'Vertical' or 'Horizontal'
10
property real position
11
property real pageSize
12
property var orientation : "Vertical"
13
property alias bgColor: background.color
14
property alias fgColor: thumb.color
16
// A light, semi-transparent background
19
radius: orientation == 'Vertical' ? (width/2 - 1) : (height/2 - 1)
20
color: "white"; opacity: 0.3
23
// Size the bar to the required size, depending upon the orientation.
28
radius: orientation == 'Vertical' ? (width/2 - 1) : (height/2 - 1)
29
x: orientation == 'Vertical' ? 1 : (scrollBar.position * (scrollBar.width-2) + 1)
30
y: orientation == 'Vertical' ? (scrollBar.position * (scrollBar.height-2) + 1) : 1
31
width: orientation == 'Vertical' ? (parent.width-2) : (scrollBar.pageSize * (scrollBar.width-2))
32
height: orientation == 'Vertical' ? (scrollBar.pageSize * (scrollBar.height-2)) : (parent.height-2)