mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
set custom style earlier in initialization
This commit is contained in:
parent
3b97f082e8
commit
3bab1b6829
2 changed files with 12 additions and 5 deletions
|
@ -169,11 +169,6 @@ def run():
|
||||||
ui.splash.update()
|
ui.splash.update()
|
||||||
|
|
||||||
mw = ui.main.AnkiQt(app, conf, args)
|
mw = ui.main.AnkiQt(app, conf, args)
|
||||||
try:
|
|
||||||
styleFile = open(os.path.join(opts.config, "style.css"))
|
|
||||||
mw.setStyleSheet(styleFile.read())
|
|
||||||
except (IOError, OSError):
|
|
||||||
pass
|
|
||||||
|
|
||||||
app.exec_()
|
app.exec_()
|
||||||
|
|
||||||
|
|
|
@ -44,6 +44,7 @@ class AnkiQt(QMainWindow):
|
||||||
self.hideWelcome = False
|
self.hideWelcome = False
|
||||||
self.views = []
|
self.views = []
|
||||||
self.setLang()
|
self.setLang()
|
||||||
|
self.setupStyle()
|
||||||
self.setupFonts()
|
self.setupFonts()
|
||||||
self.setupBackupDir()
|
self.setupBackupDir()
|
||||||
self.setupProxy()
|
self.setupProxy()
|
||||||
|
@ -2468,6 +2469,17 @@ Couldn't contact Anki Online. Please check your internet connection.""")
|
||||||
for (s, p) in anki.fonts.substitutions():
|
for (s, p) in anki.fonts.substitutions():
|
||||||
QFont.insertSubstitution(s, p)
|
QFont.insertSubstitution(s, p)
|
||||||
|
|
||||||
|
# Custom styles
|
||||||
|
##########################################################################
|
||||||
|
|
||||||
|
def setupStyle(self):
|
||||||
|
try:
|
||||||
|
styleFile = open(os.path.join(self.config.configPath,
|
||||||
|
"style.css"))
|
||||||
|
self.setStyleSheet(styleFile.read())
|
||||||
|
except (IOError, OSError):
|
||||||
|
pass
|
||||||
|
|
||||||
# Sounds
|
# Sounds
|
||||||
##########################################################################
|
##########################################################################
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue