From 8117a6a58837d57eceade7cd2427b80c9f786fa5 Mon Sep 17 00:00:00 2001 From: Auric Vente Date: Thu, 25 Jul 2024 20:37:43 -0600 Subject: [PATCH] Mods --- cromulant/args.py | 6 ++++++ cromulant/argspec.py | 18 ++++++++++++++++++ cromulant/window.py | 7 +++++-- 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/cromulant/args.py b/cromulant/args.py index 721724d..5115db5 100644 --- a/cromulant/args.py +++ b/cromulant/args.py @@ -15,6 +15,9 @@ class Args: footer: bool = True intro: bool = True title: str = "" + width: int = 0 + height: int = 0 + program: str = "" @staticmethod def prepare() -> None: @@ -36,6 +39,9 @@ class Args: normals = [ "title", + "width", + "height", + "program", ] for n_item in normals: diff --git a/cromulant/argspec.py b/cromulant/argspec.py index 696a720..d99a780 100644 --- a/cromulant/argspec.py +++ b/cromulant/argspec.py @@ -105,3 +105,21 @@ class ArgSpec: type=str, 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", + ) diff --git a/cromulant/window.py b/cromulant/window.py index 4bb4c8e..027eb34 100644 --- a/cromulant/window.py +++ b/cromulant/window.py @@ -133,12 +133,15 @@ class Window: @staticmethod def make() -> None: Window.app = QApplication([]) - Window.app.setApplicationName(Config.program) + program = Args.program or Config.program + Window.app.setApplicationName(program) Window.window = QMainWindow() title = Args.title or Config.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() Window.root = QVBoxLayout()