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 background: controlsBackground
property var progress: progressBar property var progress: progressBar
property var controls: controlsBar property var controls: controlsBar
property var duration: progressBar.to
Item { Item {
id: subtitlesBar 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 { Action {
onTriggered: player.skipToNinth(parseInt(shortcut)) onTriggered: skipToNinth(parseInt(shortcut))
shortcut: "1" shortcut: "1"
} }
Action { Action {
onTriggered: player.skipToNinth(parseInt(shortcut)) onTriggered: skipToNinth(parseInt(shortcut))
shortcut: "2" shortcut: "2"
} }
Action { Action {
onTriggered: player.skipToNinth(parseInt(shortcut)) onTriggered: skipToNinth(parseInt(shortcut))
shortcut: "3" shortcut: "3"
} }
Action { Action {
onTriggered: player.skipToNinth(parseInt(shortcut)) onTriggered: skipToNinth(parseInt(shortcut))
shortcut: "4" shortcut: "4"
} }
Action { Action {
onTriggered: player.skipToNinth(parseInt(shortcut)) onTriggered: skipToNinth(parseInt(shortcut))
shortcut: "5" shortcut: "5"
} }
Action { Action {
onTriggered: player.skipToNinth(parseInt(shortcut)) onTriggered: skipToNinth(parseInt(shortcut))
shortcut: "6" shortcut: "6"
} }
Action { Action {
onTriggered: player.skipToNinth(parseInt(shortcut)) onTriggered: skipToNinth(parseInt(shortcut))
shortcut: "7" shortcut: "7"
} }
Action { Action {
onTriggered: player.skipToNinth(parseInt(shortcut)) onTriggered: skipToNinth(parseInt(shortcut))
shortcut: "8" shortcut: "8"
} }
Action { Action {
onTriggered: player.skipToNinth(parseInt(shortcut)) onTriggered: skipToNinth(parseInt(shortcut))
shortcut: "9" shortcut: "9"
} }
Action { Action {
onTriggered: player.skipToNinth(parseInt(shortcut)) onTriggered: skipToNinth(parseInt(shortcut))
shortcut: "0" 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) { function hideControls(force) {
if (!menuBar.anythingOpen() || force) { if (!menuBar.anythingOpen() || force) {
controlsShowing = false controlsShowing = false