mirror of
https://github.com/khoj-ai/khoj.git
synced 2024-12-04 04:43:01 +01:00
Open the khoj app window maximized on startup
This commit is contained in:
parent
ea734ba1c8
commit
378b96ec1b
2 changed files with 8 additions and 3 deletions
|
@ -41,10 +41,13 @@ class MainWindow(QWebEngineView):
|
||||||
|
|
||||||
self.position_window()
|
self.position_window()
|
||||||
|
|
||||||
def show_page(self, page: str = ""):
|
def show_page(self, page: str = "", maximized=False):
|
||||||
def load_page():
|
def load_page():
|
||||||
self.webpage.load(QUrl(f"{self.base_url}/{page}"))
|
self.webpage.load(QUrl(f"{self.base_url}/{page}"))
|
||||||
self.show()
|
if maximized:
|
||||||
|
self.showMaximized()
|
||||||
|
else:
|
||||||
|
self.show()
|
||||||
|
|
||||||
return load_page
|
return load_page
|
||||||
|
|
||||||
|
|
|
@ -101,7 +101,9 @@ def run():
|
||||||
logger.info(f"🌗 Khoj is running at {url}")
|
logger.info(f"🌗 Khoj is running at {url}")
|
||||||
|
|
||||||
# Show config window on first run and main window otherwise
|
# 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()
|
startup_window()
|
||||||
|
|
||||||
# Setup Signal Handlers
|
# Setup Signal Handlers
|
||||||
|
|
Loading…
Reference in a new issue