Update PlayerControl.qml changed progress into a scrubber

This commit is contained in:
2026-06-22 00:03:13 -04:00
parent 2d9c455e1e
commit fa01d709c5
+14 -2
View File
@@ -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