mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 14:32:22 -04:00
save/restore toolbar state
This commit is contained in:
parent
cfaf9388c3
commit
8e621c03fb
2 changed files with 5 additions and 2 deletions
|
@ -57,6 +57,7 @@ class Config(dict):
|
|||
'saveAfterAddingNum': 1,
|
||||
'saveOnClose': True,
|
||||
'mainWindowGeom': None,
|
||||
'mainWindowState': None,
|
||||
'suppressUpdate': False,
|
||||
'suppressEstimates': False,
|
||||
'showLastCardInterval': False,
|
||||
|
|
|
@ -49,8 +49,6 @@ class AnkiQt(QMainWindow):
|
|||
self.setupTray()
|
||||
self.connectMenuActions()
|
||||
ui.splash.update()
|
||||
if self.config['mainWindowGeom']:
|
||||
self.restoreGeometry(self.config['mainWindowGeom'])
|
||||
self.setupViews()
|
||||
self.setupEditor()
|
||||
self.setupStudyScreen()
|
||||
|
@ -58,6 +56,9 @@ class AnkiQt(QMainWindow):
|
|||
self.setupAnchors()
|
||||
self.setupToolbar()
|
||||
self.setupProgressInfo()
|
||||
if self.config['mainWindowState']:
|
||||
self.restoreGeometry(self.config['mainWindowGeom'])
|
||||
self.restoreState(self.config['mainWindowState'])
|
||||
if sys.platform.startswith("darwin"):
|
||||
self.setUnifiedTitleAndToolBarOnMac(True)
|
||||
pass
|
||||
|
@ -925,6 +926,7 @@ your deck."""))
|
|||
runHook("quit")
|
||||
self.help.hide()
|
||||
self.config['mainWindowGeom'] = self.saveGeometry()
|
||||
self.config['mainWindowState'] = self.saveState()
|
||||
# save config
|
||||
try:
|
||||
self.config.save()
|
||||
|
|
Loading…
Reference in a new issue