mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Allow setting an env var on linux to use the system Qt theme
This commit is contained in:
parent
0d690f3225
commit
fafd278b6e
@ -32,7 +32,12 @@ Environment variables
|
||||
* ``CALIBRE_TEST_TRANSLATION`` - Used to test a translation .po file (should be the path to the .po file)
|
||||
* ``CALIBRE_NO_NATIVE_FILEDIALOGS`` - Causes calibre to not use native file dialogs for selecting files/directories.
|
||||
* ``CALIBRE_NO_NATIVE_MENUBAR`` - Causes calibre to not create a native (global) menu on Ubuntu Unity and similar linux desktop environments. The menu is instead placed inside the window, as is traditional.
|
||||
* ``CALIBRE_IGNORE_SYSTEM_THEME`` - Causes calibre to ignore any system Qt style plugins and use its builtin style plugin instead. Useful to workaround crashes caused by the system Qt plugin being incompatible with the version of Qt shipped with calibre.
|
||||
* ``CALIBRE_USE_SYSTEM_THEME`` - By default, on Linux, calibre uses its own
|
||||
builtin Qt style. This is to avoid crashes and hangs caused by incompatibilities
|
||||
between the version of Qt calibre is built against and the system Qt. The
|
||||
downside is that calibre may not follow the system look and feel. If
|
||||
you set this environment variable on Linux, it will cause calibre to use
|
||||
the system theme -- beware of crashes and hangs.
|
||||
* ``CALIBRE_SHOW_DEPRECATION_WARNINGS`` - Causes calibre to print deprecation warnings to stdout. Useful for calibre developers.
|
||||
* ``CALIBRE_NO_DEFAULT_PROGRAMS`` - Prevent calibre from automatically registering the filetypes it is capable of handling with Windows.
|
||||
* ``SYSFS_PATH`` - Use if sysfs is mounted somewhere other than /sys
|
||||
|
@ -1075,12 +1075,15 @@ class Application(QApplication):
|
||||
load_builtin_fonts()
|
||||
|
||||
def setup_styles(self, force_calibre_style):
|
||||
self.using_calibre_style = force_calibre_style or 'CALIBRE_IGNORE_SYSTEM_THEME' in os.environ or (
|
||||
gprefs['ui_style'] != 'system')
|
||||
if not iswindows and not isosx:
|
||||
# Force calibre style on linux as the system style causes
|
||||
# crashes/hangs in Qt
|
||||
self.using_calibre_style = True
|
||||
if iswindows or isosx:
|
||||
using_calibre_style = gprefs['ui_style'] != 'system'
|
||||
else:
|
||||
using_calibre_style = 'CALIBRE_USE_SYSTEM_THEME' in os.environ
|
||||
if force_calibre_style:
|
||||
using_calibre_style = True
|
||||
self.using_calibre_style = using_calibre_style
|
||||
if DEBUG:
|
||||
prints('Using calibre Qt style:', self.using_calibre_style)
|
||||
if self.using_calibre_style:
|
||||
self.load_calibre_style()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user