Mods
This commit is contained in:
parent
1b21a9adcd
commit
8117a6a588
|
@ -15,6 +15,9 @@ class Args:
|
||||||
footer: bool = True
|
footer: bool = True
|
||||||
intro: bool = True
|
intro: bool = True
|
||||||
title: str = ""
|
title: str = ""
|
||||||
|
width: int = 0
|
||||||
|
height: int = 0
|
||||||
|
program: str = ""
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def prepare() -> None:
|
def prepare() -> None:
|
||||||
|
@ -36,6 +39,9 @@ class Args:
|
||||||
|
|
||||||
normals = [
|
normals = [
|
||||||
"title",
|
"title",
|
||||||
|
"width",
|
||||||
|
"height",
|
||||||
|
"program",
|
||||||
]
|
]
|
||||||
|
|
||||||
for n_item in normals:
|
for n_item in normals:
|
||||||
|
|
|
@ -105,3 +105,21 @@ class ArgSpec:
|
||||||
type=str,
|
type=str,
|
||||||
info="Custom title for the window",
|
info="Custom title for the window",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
ArgSpec.add_argument(
|
||||||
|
"width",
|
||||||
|
type=int,
|
||||||
|
info="The width of the window in pixels",
|
||||||
|
)
|
||||||
|
|
||||||
|
ArgSpec.add_argument(
|
||||||
|
"height",
|
||||||
|
type=int,
|
||||||
|
info="The height of the window in pixels",
|
||||||
|
)
|
||||||
|
|
||||||
|
ArgSpec.add_argument(
|
||||||
|
"program",
|
||||||
|
type=str,
|
||||||
|
info="The internal name of the program",
|
||||||
|
)
|
||||||
|
|
|
@ -133,12 +133,15 @@ class Window:
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def make() -> None:
|
def make() -> None:
|
||||||
Window.app = QApplication([])
|
Window.app = QApplication([])
|
||||||
Window.app.setApplicationName(Config.program)
|
program = Args.program or Config.program
|
||||||
|
Window.app.setApplicationName(program)
|
||||||
|
|
||||||
Window.window = QMainWindow()
|
Window.window = QMainWindow()
|
||||||
title = Args.title or Config.title
|
title = Args.title or Config.title
|
||||||
Window.window.setWindowTitle(title)
|
Window.window.setWindowTitle(title)
|
||||||
Window.window.resize(Config.width, Config.height)
|
width = Args.width or Config.width
|
||||||
|
height = Args.height or Config.height
|
||||||
|
Window.window.resize(width, height)
|
||||||
|
|
||||||
central_widget = QWidget()
|
central_widget = QWidget()
|
||||||
Window.root = QVBoxLayout()
|
Window.root = QVBoxLayout()
|
||||||
|
|
Loading…
Reference in New Issue