mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-02 06:31:08 +00:00
playback/player: qt: seek while dragging seek bar
removed time label on top the seek bar, should be placed elsewhere
This commit is contained in:
parent
a8f242d48c
commit
736ba93518
1 changed files with 5 additions and 21 deletions
|
@ -644,9 +644,14 @@ ApplicationWindow {
|
||||||
maximumValue: player.duration
|
maximumValue: player.duration
|
||||||
value: player.position
|
value: player.position
|
||||||
onPressedChanged: player.seek(value)
|
onPressedChanged: player.seek(value)
|
||||||
|
onValueChanged: {
|
||||||
|
if (pressed)
|
||||||
|
player.seek(value)
|
||||||
|
}
|
||||||
enabled: player.mediaInfo.seekable
|
enabled: player.mediaInfo.seekable
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
updateValueWhileDragging: true
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
id: sliderMouseArea
|
id: sliderMouseArea
|
||||||
|
@ -662,27 +667,6 @@ ApplicationWindow {
|
||||||
onPressAndHold: mouse.accepted = false;
|
onPressAndHold: mouse.accepted = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
id: hoveredcliptime
|
|
||||||
width: 40
|
|
||||||
height: 17
|
|
||||||
color: "lightgray"
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
visible: sliderMouseArea.containsMouse
|
|
||||||
x: sliderMouseArea.mouseX
|
|
||||||
|
|
||||||
Text {
|
|
||||||
font.pixelSize: 13
|
|
||||||
color: "black"
|
|
||||||
anchors.centerIn: parent
|
|
||||||
text: {
|
|
||||||
var value = (sliderMouseArea.mouseX - slider.x) * player.duration / (slider.width - slider.x)
|
|
||||||
var date = new Date(Math.floor(value / 1e6));
|
|
||||||
date.getMinutes() + ":" + ('0' + date.getSeconds()).slice(-2)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
style: SliderStyle {
|
style: SliderStyle {
|
||||||
groove: Item {
|
groove: Item {
|
||||||
implicitWidth: playbar.width
|
implicitWidth: playbar.width
|
||||||
|
|
Loading…
Reference in a new issue