Open the khoj app window maximized on startup

This commit is contained in:
Debanjum Singh Solanky 2023-08-07 15:39:05 -07:00
parent ea734ba1c8
commit 378b96ec1b
2 changed files with 8 additions and 3 deletions

View file

@ -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

View file

@ -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