Touch UI: Playback position slider + new slider theme

This commit is contained in:
Thomas Perl 2014-02-02 16:30:02 +01:00
parent 7f5aa932f7
commit 9b9c70b99a
2 changed files with 24 additions and 12 deletions

View file

@ -29,7 +29,8 @@ Rectangle {
signal valueChangeRequested(real newValue) signal valueChangeRequested(real newValue)
color: '#aa000000' clip: true
color: '#000000'
height: 50 * pgst.scalef height: 50 * pgst.scalef
@ -39,15 +40,27 @@ Rectangle {
} }
Rectangle { Rectangle {
height: parent.height * 0.9 id: fillBackground
width: height color: '#333333'
height: parent.height * 0.8
color: '#aaffffff' width: parent.width * (parent.value - parent.min) / (parent.max - parent.min)
anchors { anchors {
verticalCenter: parent.verticalCenter verticalCenter: parent.verticalCenter
left: parent.left }
leftMargin: parent.width * (parent.value - parent.min) / (parent.max - parent.min) }
Rectangle {
height: parent.height * 0.9
width: height
radius: width / 2
color: '#666666'
anchors {
verticalCenter: parent.verticalCenter
left: fillBackground.right
leftMargin: -(width / 2)
} }
} }
} }

View file

@ -70,12 +70,11 @@ SlidePage {
PSlider { PSlider {
width: playerPage.width width: playerPage.width
value: player.playbackRate value: player.position
min: 0.5 min: 0
max: 3.0 max: player.duration
onValueChangeRequested: { onValueChangeRequested: {
player.playbackRate = newValue player.seekAndSync(newValue);
value = player.playbackRate
} }
} }
} }