Update PlayerControl.qml changed progress into a scrubber
This commit is contained in:
+14
-2
@@ -188,10 +188,11 @@ Item {
|
||||
elide: Text.ElideRight
|
||||
text: playerController.player?.trackArtist
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: scrubber
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: 4
|
||||
Layout.preferredHeight: 8
|
||||
Layout.rightMargin: 8
|
||||
color: blendedColors.colLayer1
|
||||
visible: playerController.player?.length > 0
|
||||
|
||||
@@ -203,6 +204,17 @@ Item {
|
||||
width: (playerController.player?.position / playerController.player?.length) * parent.width
|
||||
radius: parent.height / 2
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
id: scrubberInteract
|
||||
anchors.fill: parent
|
||||
onClicked: {
|
||||
if (playerController.player) {
|
||||
var pos = (mouseX / parent.width) * playerController.player.length
|
||||
playerController.player.position = pos
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
RowLayout {
|
||||
Layout.fillWidth: true
|
||||
|
||||
Reference in New Issue
Block a user