1
0
Fork 0

Make progress bar show correct value on hover.

This commit is contained in:
namedkitten 2020-04-26 22:45:04 +01:00
parent 7d916ea1df
commit f1fccdefce
5 changed files with 10 additions and 5 deletions

View file

@ -50,11 +50,15 @@ Item {
id: progressBar id: progressBar
visible: controlsBarItem.controlsShowing && appearance.themeName != "RoosterTeeth" visible: controlsBarItem.controlsShowing && appearance.themeName != "RoosterTeeth"
bottomPadding: 0 bottomPadding: 0
rightPadding: 0
leftPadding: 0
z: 20 z: 20
anchors { anchors {
bottom: controlsBackground.top bottom: controlsBackground.top
left: controlsBackground.left left: controlsBackground.left
right: controlsBackground.right right: controlsBackground.right
leftMargin: parent.width / 128
rightMargin: parent.width / 128
bottomMargin: 0 bottomMargin: 0
} }
} }

View file

@ -75,6 +75,8 @@ Item {
right: speedText.left right: speedText.left
rightMargin: parent.width / 128 rightMargin: parent.width / 128
} }
rightPadding: 0
leftPadding: 0
height: parent.height height: parent.height
to: progressBar.to to: progressBar.to
value: progressBar.value value: progressBar.value

View file

@ -94,9 +94,8 @@ Slider {
onExited: timestampBox.visible = false onExited: timestampBox.visible = false
onPositionChanged: { onPositionChanged: {
var a = (progressBar.to / progressBar.availableWidth) // code taken from https://github.com/qt/qtquickcontrols2/blob/39892547145ba4e73bebee86352bd384732b5d19/src/quicktemplates2/qquickslider.cpp#L138
* (mouseAreaProgressBar.mapToItem( var a = ((mouseAreaProgressBar.mouseX - (handleRect.width / 2)) / (progressBar.availableWidth - handleRect.width)) * progressBar.to
progressBar, mouseAreaProgressBar.mouseX, 0).x - 2)
hoverProgressLabel.text = utils.createTimestamp(a) hoverProgressLabel.text = utils.createTimestamp(a)
timestampBox.x = mouseAreaProgressBar.mouseX - (timestampBox.width / 2) timestampBox.x = mouseAreaProgressBar.mouseX - (timestampBox.width / 2)
timestampBox.y = progressBackground.y - timestampBox.height * 2 timestampBox.y = progressBackground.y - timestampBox.height * 2

View file

@ -147,7 +147,7 @@ var translations = {
TITLE_ONLY_ON_FULLSCREEN: "Titel nur in Vollbildmodus anzeigen", TITLE_ONLY_ON_FULLSCREEN: "Titel nur in Vollbildmodus anzeigen",
CLICK_TO_PAUSE: "Tap/Klick pausiert", CLICK_TO_PAUSE: "Tap/Klick pausiert",
DOUBLE_TAP_TO_SEEK: "Doppel-Tap/Klick spult", 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", FONT: "Schriftart",
SUBTITLES_FONT_SIZE: "Schriftgröße Untertitel", SUBTITLES_FONT_SIZE: "Schriftgröße Untertitel",
UI_FADE_TIME: "Ausblendzeit Benutzeroberfläche (ms)" UI_FADE_TIME: "Ausblendzeit Benutzeroberfläche (ms)"

View file

@ -1 +1 @@
3 4