mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 10:14:46 -04:00
Make is_dark_theme() not raise an exception when no QApplication is constructed
This commit is contained in:
parent
a87958eacb
commit
4c3a1606f2
@ -1002,8 +1002,11 @@ def choose_files_and_remember_all_files(
|
||||
|
||||
|
||||
def is_dark_theme():
|
||||
pal = QApplication.instance().palette()
|
||||
return pal.is_dark_theme()
|
||||
app = QApplication.instance()
|
||||
if app is not None:
|
||||
pal = QApplication.instance().palette()
|
||||
return pal.is_dark_theme()
|
||||
return False
|
||||
|
||||
|
||||
def choose_osx_app(window, name, title, default_dir='/Applications'):
|
||||
|
Loading…
x
Reference in New Issue
Block a user