Add arguments without = support and fullscreen argument.
This commit is contained in:
parent
6f9919869f
commit
b072e60fc8
|
@ -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,7 +141,14 @@ 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(/=(.+)/)
|
||||||
renderer.setOption(splitArg[0], splitArg[1])
|
if (splitArg[0] == "fullscreen") {
|
||||||
|
toggleFullscreen()
|
||||||
|
} else {
|
||||||
|
if (splitArg[1].length == 0) {
|
||||||
|
splitArg[1] = "true"
|
||||||
|
}
|
||||||
|
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 {
|
||||||
|
|
Loading…
Reference in a new issue