1
0
Fork 0

[UI] Fix skipToNinth.

This commit is contained in:
NamedKitten 2018-11-21 10:26:39 +00:00
parent d5f4ab408f
commit 7dd808a93f
3 changed files with 19 additions and 18 deletions

View file

@ -15,6 +15,7 @@ Item {
property var background: controlsBackground
property var progress: progressBar
property var controls: controlsBar
property var duration: progressBar.to
Item {
id: subtitlesBar

View file

@ -493,44 +493,52 @@ MenuBar {
}
}
function skipToNinth(val) {
var skipto = 0
if (val != 0) {
skipto = Math.floor(controlsBar.duration / 9 * val)
}
player.playerCommand(Enums.Commands.SeekAbsolute, skipto)
}
Action {
onTriggered: player.skipToNinth(parseInt(shortcut))
onTriggered: skipToNinth(parseInt(shortcut))
shortcut: "1"
}
Action {
onTriggered: player.skipToNinth(parseInt(shortcut))
onTriggered: skipToNinth(parseInt(shortcut))
shortcut: "2"
}
Action {
onTriggered: player.skipToNinth(parseInt(shortcut))
onTriggered: skipToNinth(parseInt(shortcut))
shortcut: "3"
}
Action {
onTriggered: player.skipToNinth(parseInt(shortcut))
onTriggered: skipToNinth(parseInt(shortcut))
shortcut: "4"
}
Action {
onTriggered: player.skipToNinth(parseInt(shortcut))
onTriggered: skipToNinth(parseInt(shortcut))
shortcut: "5"
}
Action {
onTriggered: player.skipToNinth(parseInt(shortcut))
onTriggered: skipToNinth(parseInt(shortcut))
shortcut: "6"
}
Action {
onTriggered: player.skipToNinth(parseInt(shortcut))
onTriggered: skipToNinth(parseInt(shortcut))
shortcut: "7"
}
Action {
onTriggered: player.skipToNinth(parseInt(shortcut))
onTriggered: skipToNinth(parseInt(shortcut))
shortcut: "8"
}
Action {
onTriggered: player.skipToNinth(parseInt(shortcut))
onTriggered: skipToNinth(parseInt(shortcut))
shortcut: "9"
}
Action {
onTriggered: player.skipToNinth(parseInt(shortcut))
onTriggered: skipToNinth(parseInt(shortcut))
shortcut: "0"
}

View file

@ -183,14 +183,6 @@ ApplicationWindow {
}
}
function skipToNinth(val) {
var skipto = 0
if (val != 0) {
skipto = Math.floor(controlsBar.controls.progress.to / 9 * val)
}
player.playerCommand(Enums.Commands.SeekAbsolute, skipto)
}
function hideControls(force) {
if (!menuBar.anythingOpen() || force) {
controlsShowing = false