diff --git a/src/calibre/gui2/__init__.py b/src/calibre/gui2/__init__.py
index 30588a8866..b07dacf572 100644
--- a/src/calibre/gui2/__init__.py
+++ b/src/calibre/gui2/__init__.py
@@ -8,7 +8,7 @@ from PyQt4.Qt import (QVariant, QFileInfo, QObject, SIGNAL, QBuffer, Qt,
QByteArray, QTranslator, QCoreApplication, QThread,
QEvent, QTimer, pyqtSignal, QDateTime, QDesktopServices,
QFileDialog, QFileIconProvider, QSettings,
- QIcon, QApplication, QDialog, QUrl, QFont)
+ QIcon, QApplication, QDialog, QUrl, QFont, QPalette)
ORG_NAME = 'KovidsBrain'
APP_UID = 'libprs500'
@@ -106,6 +106,7 @@ gprefs.defaults['auto_add_path'] = None
gprefs.defaults['auto_add_check_for_duplicates'] = False
gprefs.defaults['blocked_auto_formats'] = []
gprefs.defaults['auto_add_auto_convert'] = True
+gprefs.defaults['widget_style'] = 'system'
# }}}
NONE = QVariant() #: Null value to return from the data function of item models
@@ -737,17 +738,26 @@ 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 isbsd) and st in ('windows', 'motif', 'cde'):
- from PyQt4.Qt import QStyleFactory
- styles = set(map(unicode, QStyleFactory.keys()))
- if 'Plastique' in styles and os.environ.get('KDE_FULL_SESSION',
- False):
- self.setStyle('Plastique')
- elif 'Cleanlooks' in styles:
- self.setStyle('Cleanlooks')
+ self.setup_styles()
+
+ def setup_styles(self):
+ if gprefs['widget_style'] != 'system':
+ # On OS X QtCurve resets the palette, so we preserve it explicitly
+ orig_pal = QPalette(self.palette())
+ QApplication.setStyle('QtCurve')
+ self.setPalette(orig_pal)
+ else:
+ st = self.style()
+ if st is not None:
+ st = unicode(st.objectName()).lower()
+ if (islinux or isbsd) and st in ('windows', 'motif', 'cde'):
+ from PyQt4.Qt import QStyleFactory
+ styles = set(map(unicode, QStyleFactory.keys()))
+ if 'Plastique' in styles and os.environ.get('KDE_FULL_SESSION',
+ False):
+ self.setStyle('Plastique')
+ elif 'Cleanlooks' in styles:
+ self.setStyle('Cleanlooks')
def _send_file_open_events(self):
with self._file_open_lock:
diff --git a/src/calibre/gui2/preferences/look_feel.py b/src/calibre/gui2/preferences/look_feel.py
index 2117de009c..2c675d1ee2 100644
--- a/src/calibre/gui2/preferences/look_feel.py
+++ b/src/calibre/gui2/preferences/look_feel.py
@@ -101,6 +101,9 @@ class ConfigWidget(ConfigWidgetBase, Ui_Form):
r('gui_layout', config, restart_required=True, choices=
[(_('Wide'), 'wide'), (_('Narrow'), 'narrow')])
+ r('widget_style', gprefs, restart_required=True, choices=
+ [(_('System default'), 'system'), (_('Calibre style'),
+ 'calibre')])
r('cover_flow_queue_length', config, restart_required=True)
diff --git a/src/calibre/gui2/preferences/look_feel.ui b/src/calibre/gui2/preferences/look_feel.ui
index 73e0a85a68..792dd25ec1 100644
--- a/src/calibre/gui2/preferences/look_feel.ui
+++ b/src/calibre/gui2/preferences/look_feel.ui
@@ -28,7 +28,34 @@
Main Interface
- -
+
-
+
+
+ Choose &language (requires restart):
+
+
+ opt_language
+
+
+
+ -
+
+
+ QComboBox::AdjustToMinimumContentsLengthWithIcon
+
+
+ 20
+
+
+
+ -
+
+
+ Enable system &tray icon (needs restart)
+
+
+
+ -
User Interface &layout (needs restart):
@@ -38,7 +65,7 @@
- -
+
-
@@ -54,34 +81,7 @@
- -
-
-
- Choose &language (requires restart):
-
-
- opt_language
-
-
-
- -
-
-
- QComboBox::AdjustToMinimumContentsLengthWithIcon
-
-
- 20
-
-
-
- -
-
-
- Enable system &tray icon (needs restart)
-
-
-
- -
+
-
Disable all animations. Useful if you have a slow/old computer.
@@ -91,21 +91,21 @@
- -
+
-
Disable ¬ifications in system tray
- -
+
-
Show &splash screen at startup
- -
+
-
&Toolbar
@@ -140,7 +140,20 @@
- -
+
-
+
+
+ Qt::Vertical
+
+
+
+ 20
+ 40
+
+
+
+
+ -
-
@@ -161,25 +174,25 @@
- -
+
-
Change &font (needs restart)
- -
-
-
- Qt::Vertical
+
-
+
+
+ User interface &style (needs restart):
-
-
- 20
- 40
-
+
+ opt_widget_style
-
+
+
+ -
+