Commit 48fbf1aa authored by Georgiy Yankovskiy's avatar Georgiy Yankovskiy

Fullscreen CLI option

parent 3d2434b3
import argparse
import sys
from pathlib import Path
from PySide6.QtGui import QGuiApplication
from typing import cast
from PySide6.QtGui import QGuiApplication, QWindow
from PySide6.QtQml import QQmlApplicationEngine
from ingame.models.App import App
from ingame.models.GamesModel import GamesModel
# TODO: add VirtualKeyboard
def main():
def main(fullscreen: bool = False):
app = QGuiApplication(sys.argv)
app_model = App()
app.aboutToQuit.connect(app_model.close_event)
qml_file = Path(__file__).resolve().parent / "../qml/qml.qml"
engine = QQmlApplicationEngine()
......@@ -24,8 +25,21 @@ def main():
if not engine.rootObjects():
sys.exit(-1)
window: QWindow = cast(QWindow, engine.rootObjects()[0])
window.setVisibility(fullscreen and window.Visibility.FullScreen or window.Visibility.Windowed)
sys.exit(app.exec())
if __name__ == "__main__":
main()
parser = argparse.ArgumentParser(description="Game listing and launcher application")
parser.add_argument(
"--fullscreen",
type=bool,
help="whether to force use fullscreen mode for application or not",
required=False,
action=argparse.BooleanOptionalAction
)
args = parser.parse_args()
main(fullscreen=args.fullscreen or False)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment