From 517abea68ed856d301575bd7357a9551e7b2c371 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 13 May 2011 14:43:56 -0600 Subject: [PATCH] Linux binaries: Always use either Cleanlook or Plastique styles for the GUI if no style can be loaded from the host computer --- src/calibre/gui2/__init__.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/calibre/gui2/__init__.py b/src/calibre/gui2/__init__.py index 28504f2a31..3270fcfde5 100644 --- a/src/calibre/gui2/__init__.py +++ b/src/calibre/gui2/__init__.py @@ -625,6 +625,16 @@ class Application(QApplication): if s is not None: font.setStretch(s) QApplication.setFont(font) + st = self.style() + if st is not None: + st = unicode(st.objectName()).lower() + if (islinux or isfreebsd) and st in ('windows', 'motif', 'cde'): + from PyQt4.Qt import QStyleFactory + styles = set(map(unicode, QStyleFactory.keys())) + if 'Cleanlooks' in styles: + self.setStyle('Cleanlooks') + else: + self.setStyle('Plastique') def _send_file_open_events(self): with self._file_open_lock: