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