set custom style earlier in initialization

This commit is contained in:
Damien Elmes 2009-06-08 22:45:16 +09:00
parent 3b97f082e8
commit 3bab1b6829
2 changed files with 12 additions and 5 deletions

View file

@ -169,11 +169,6 @@ def run():
ui.splash.update()
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_()

View file

@ -44,6 +44,7 @@ class AnkiQt(QMainWindow):
self.hideWelcome = False
self.views = []
self.setLang()
self.setupStyle()
self.setupFonts()
self.setupBackupDir()
self.setupProxy()
@ -2468,6 +2469,17 @@ Couldn't contact Anki Online. Please check your internet connection.""")
for (s, p) in anki.fonts.substitutions():
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
##########################################################################