Skip to content

Commit

Permalink
Don't error if dark mode is unavailable
Browse files Browse the repository at this point in the history
  • Loading branch information
Et0h committed Nov 10, 2021
1 parent 8423b20 commit 5a9e871
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions syncplay/ui/ConfigurationGetter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5a9e871

Please sign in to comment.