From 5a9e871c12312c55355a9eb75df15c66bb4238ac Mon Sep 17 00:00:00 2001 From: et0h Date: Wed, 10 Nov 2021 18:54:52 +0000 Subject: [PATCH] Don't error if dark mode is unavailable --- syncplay/ui/ConfigurationGetter.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/syncplay/ui/ConfigurationGetter.py b/syncplay/ui/ConfigurationGetter.py index 5d15798c..f304d47d 100755 --- a/syncplay/ui/ConfigurationGetter.py +++ b/syncplay/ui/ConfigurationGetter.py @@ -521,12 +521,15 @@ def getConfiguration(self): raise ImportError if QCoreApplication.instance() is None: self.app = QtWidgets.QApplication(sys.argv) - if isWindows(): - from syncplay.vendor import darkdetect - isDarkMode = darkdetect.isDark() - if isDarkMode: - self.app.setStyle(QtWidgets.QStyleFactory.create("fusion")) - self.app.setPalette(self.getDarkPalette(QtGui)) + try: + if isWindows(): + from syncplay.vendor import darkdetect + isDarkMode = darkdetect.isDark() + if isDarkMode: + self.app.setStyle(QtWidgets.QStyleFactory.create("fusion")) + self.app.setPalette(self.getDarkPalette(QtGui)) + except: + pass qt5reactor.install() if isMacOS(): import appnope