Make progress bar show correct value on hover.
This commit is contained in:
parent
7d916ea1df
commit
f1fccdefce
|
@ -50,11 +50,15 @@ Item {
|
|||
id: progressBar
|
||||
visible: controlsBarItem.controlsShowing && appearance.themeName != "RoosterTeeth"
|
||||
bottomPadding: 0
|
||||
rightPadding: 0
|
||||
leftPadding: 0
|
||||
z: 20
|
||||
anchors {
|
||||
bottom: controlsBackground.top
|
||||
left: controlsBackground.left
|
||||
right: controlsBackground.right
|
||||
leftMargin: parent.width / 128
|
||||
rightMargin: parent.width / 128
|
||||
bottomMargin: 0
|
||||
}
|
||||
}
|
||||
|
|
|
@ -75,6 +75,8 @@ Item {
|
|||
right: speedText.left
|
||||
rightMargin: parent.width / 128
|
||||
}
|
||||
rightPadding: 0
|
||||
leftPadding: 0
|
||||
height: parent.height
|
||||
to: progressBar.to
|
||||
value: progressBar.value
|
||||
|
|
|
@ -94,9 +94,8 @@ Slider {
|
|||
onExited: timestampBox.visible = false
|
||||
|
||||
onPositionChanged: {
|
||||
var a = (progressBar.to / progressBar.availableWidth)
|
||||
* (mouseAreaProgressBar.mapToItem(
|
||||
progressBar, mouseAreaProgressBar.mouseX, 0).x - 2)
|
||||
// code taken from https://github.com/qt/qtquickcontrols2/blob/39892547145ba4e73bebee86352bd384732b5d19/src/quicktemplates2/qquickslider.cpp#L138
|
||||
var a = ((mouseAreaProgressBar.mouseX - (handleRect.width / 2)) / (progressBar.availableWidth - handleRect.width)) * progressBar.to
|
||||
hoverProgressLabel.text = utils.createTimestamp(a)
|
||||
timestampBox.x = mouseAreaProgressBar.mouseX - (timestampBox.width / 2)
|
||||
timestampBox.y = progressBackground.y - timestampBox.height * 2
|
||||
|
|
|
@ -147,7 +147,7 @@ var translations = {
|
|||
TITLE_ONLY_ON_FULLSCREEN: "Titel nur in Vollbildmodus anzeigen",
|
||||
CLICK_TO_PAUSE: "Tap/Klick pausiert",
|
||||
DOUBLE_TAP_TO_SEEK: "Doppel-Tap/Klick spult",
|
||||
DOUBLE_TAP_TO_SEEK_BY: "Spulen um",
|
||||
DOUBLE_TAP_TO_SEEK_BY: "Spulen um (s)",
|
||||
FONT: "Schriftart",
|
||||
SUBTITLES_FONT_SIZE: "Schriftgröße Untertitel",
|
||||
UI_FADE_TIME: "Ausblendzeit Benutzeroberfläche (ms)"
|
||||
|
|
Loading…
Reference in a new issue