Skip to content

Commit

Permalink
Delay the showing of the main window until all themes are applied fully
Browse files Browse the repository at this point in the history
  • Loading branch information
jonoomph committed Jul 8, 2024
1 parent db38836 commit f28e634
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
6 changes: 6 additions & 0 deletions src/classes/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,12 @@ def gui(self):
# Connect our exit signals
self.aboutToQuit.connect(self.cleanup)

# Process any queued events
QApplication.processEvents()

# Show main window
self.window.show()

args = self.args
if len(args) < 2:
# Recover backup file (this can't happen until after the Main Window has completely loaded)
Expand Down
7 changes: 2 additions & 5 deletions src/windows/main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -3482,21 +3482,18 @@ def __init__(self, *args):
self.toolBar.topLevelChanged.connect(
functools.partial(self.freezeMainToolBar, None))

# Show window
self.show()

# Create tutorial manager
self.tutorial_manager = TutorialManager(self)

# Apply saved window geometry/state from settings
if self.saved_geometry:
try:
QTimer.singleShot(100, functools.partial(self.restoreGeometry, self.saved_geometry))
QTimer.singleShot(0, functools.partial(self.restoreGeometry, self.saved_geometry))
except Exception as e:
log.error(f"Error restoring window geometry: {e}")
if self.saved_state:
try:
QTimer.singleShot(100, functools.partial(self.restoreState, self.saved_state))
QTimer.singleShot(0, functools.partial(self.restoreState, self.saved_state))
except Exception as e:
log.error(f"Error restoring window state: {e}")

Expand Down

0 comments on commit f28e634

Please sign in to comment.