diff --git a/ankiqt/__init__.py b/ankiqt/__init__.py index ccac5d96e..676382e46 100644 --- a/ankiqt/__init__.py +++ b/ankiqt/__init__.py @@ -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_() diff --git a/ankiqt/ui/main.py b/ankiqt/ui/main.py index 961b114fd..10470d3de 100644 --- a/ankiqt/ui/main.py +++ b/ankiqt/ui/main.py @@ -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 ##########################################################################