mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
defer top toolbar drawing until after add-ons loaded
https://forums.ankiweb.net/t/anki-2-1-28-beta/629/13
This commit is contained in:
parent
dfda5750a1
commit
04b1ca7559
1 changed files with 5 additions and 1 deletions
|
@ -101,6 +101,7 @@ class AnkiQt(QMainWindow):
|
|||
try:
|
||||
self.setupUI()
|
||||
self.setupAddons(args)
|
||||
self.finish_ui_setup()
|
||||
except:
|
||||
showInfo(_("Error during startup:\n%s") % traceback.format_exc())
|
||||
sys.exit(1)
|
||||
|
@ -154,6 +155,10 @@ class AnkiQt(QMainWindow):
|
|||
self.setupOverview()
|
||||
self.setupReviewer()
|
||||
|
||||
def finish_ui_setup(self) -> None:
|
||||
"Actions that are deferred until after add-on loading."
|
||||
self.toolbar.draw()
|
||||
|
||||
def setupProfileAfterWebviewsLoaded(self):
|
||||
for w in (self.web, self.bottomWeb):
|
||||
if not w._domDone:
|
||||
|
@ -763,7 +768,6 @@ title="%s" %s>%s</button>""" % (
|
|||
tweb = self.toolbarWeb = aqt.webview.AnkiWebView(title="top toolbar")
|
||||
tweb.setFocusPolicy(Qt.WheelFocus)
|
||||
self.toolbar = aqt.toolbar.Toolbar(self, tweb)
|
||||
self.toolbar.draw()
|
||||
# main area
|
||||
self.web = aqt.webview.AnkiWebView(title="main webview")
|
||||
self.web.setFocusPolicy(Qt.WheelFocus)
|
||||
|
|
Loading…
Reference in a new issue