From 378b96ec1b25fbe06d1c2a0806951bfd57628be3 Mon Sep 17 00:00:00 2001 From: Debanjum Singh Solanky Date: Mon, 7 Aug 2023 15:39:05 -0700 Subject: [PATCH] Open the khoj app window maximized on startup --- src/khoj/interface/desktop/main_window.py | 7 +++++-- src/khoj/main.py | 4 +++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/khoj/interface/desktop/main_window.py b/src/khoj/interface/desktop/main_window.py index 473e7bd4..12702337 100644 --- a/src/khoj/interface/desktop/main_window.py +++ b/src/khoj/interface/desktop/main_window.py @@ -41,10 +41,13 @@ class MainWindow(QWebEngineView): self.position_window() - def show_page(self, page: str = ""): + def show_page(self, page: str = "", maximized=False): def load_page(): self.webpage.load(QUrl(f"{self.base_url}/{page}")) - self.show() + if maximized: + self.showMaximized() + else: + self.show() return load_page diff --git a/src/khoj/main.py b/src/khoj/main.py index a1780e1b..e311f73b 100644 --- a/src/khoj/main.py +++ b/src/khoj/main.py @@ -101,7 +101,9 @@ def run(): logger.info(f"🌗 Khoj is running at {url}") # Show config window on first run and main window otherwise - startup_window = main_window.show_page() if args.config else main_window.show_page("config") + startup_window = ( + main_window.show_page(maximized=True) if args.config else main_window.show_page("config", maximized=True) + ) startup_window() # Setup Signal Handlers