1
0
Fork 0

Add arguments without = support and fullscreen argument.

This commit is contained in:
NamedKitten 2018-10-14 17:58:36 +01:00
parent 6f9919869f
commit b072e60fc8

View file

@ -16,6 +16,15 @@ ApplicationWindow {
property int lastScreenVisibility property int lastScreenVisibility
function toggleFullscreen(){
if (mainWindow.visibility != Window.FullScreen) {
lastScreenVisibility = mainWindow.visibility
mainWindow.visibility = Window.FullScreen
} else {
mainWindow.visibility = lastScreenVisibility
}
}
function updatePlayPauseIcon() { function updatePlayPauseIcon() {
var paused = renderer.getProperty("pause") var paused = renderer.getProperty("pause")
if (paused) { if (paused) {
@ -132,8 +141,15 @@ ApplicationWindow {
argument = argument.substr(2) argument = argument.substr(2)
if (argument.length > 0) { if (argument.length > 0) {
var splitArg = argument.split(/=(.+)/) var splitArg = argument.split(/=(.+)/)
if (splitArg[0] == "fullscreen") {
toggleFullscreen()
} else {
if (splitArg[1].length == 0) {
splitArg[1] = "true"
}
renderer.setOption(splitArg[0], splitArg[1]) renderer.setOption(splitArg[0], splitArg[1])
} }
}
} else { } else {
renderer.command(["loadfile", argument, "append-play"]) renderer.command(["loadfile", argument, "append-play"])
} }
@ -635,12 +651,7 @@ ApplicationWindow {
anchors.right: parent.right anchors.right: parent.right
display: AbstractButton.IconOnly display: AbstractButton.IconOnly
onClicked: { onClicked: {
if (mainWindow.visibility != Window.FullScreen) { toggleFullscreen()
lastScreenVisibility = mainWindow.visibility
mainWindow.visibility = Window.FullScreen
} else {
mainWindow.visibility = lastScreenVisibility
}
} }
background: Rectangle { background: Rectangle {