1
0
Fork 0

[UI] Added testing screen changing.

This commit is contained in:
Kitteh 2018-11-10 23:10:57 +00:00
parent acba1953db
commit edff89b22e

View file

@ -9,7 +9,7 @@ import player 1.0
import "codes.js" as LanguageCodes import "codes.js" as LanguageCodes
ApplicationWindow { Window {
id: mainWindow id: mainWindow
title: titleLabel.text title: titleLabel.text
visible: true visible: true
@ -18,6 +18,7 @@ ApplicationWindow {
Translator { Translator {
id: translate id: translate
} }
screen: Qt.application.screens[0]
property int lastScreenVisibility property int lastScreenVisibility
@ -87,14 +88,27 @@ 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] == "screen") {
for (var i = 0, len = Qt.application.screens.length; i < len; i++) {
var screen = Qt.application.screens[i];
console.log(screen["name"])
if (screen["name"] == splitArg[1]) {
console.log("Switching to window: " + screen["name"])
mainWindow.screen = screen
continue
}
}
continue
}
if (splitArg[0] == "fullscreen") { if (splitArg[0] == "fullscreen") {
toggleFullscreen() toggleFullscreen()
} else { continue;
if (splitArg[1].length == 0) { }
splitArg[1] = "true" if (splitArg[1].length == 0) {
} splitArg[1] = "true"
player.setOption(splitArg[0], splitArg[1])
} }
player.setOption(splitArg[0], splitArg[1])
} }
} else { } else {
player.loadFile(argument) player.loadFile(argument)