02-13-2013, 10:48 AM | #1 |
Enthusiast
Posts: 31
Karma: 10
Join Date: Jan 2013
Device: Kobo Libra 2 & Aura HD, Cybook Muse
|
Calibre GUI styling
Hi,
Before all, I wish to thank all the Calibre developers for all their high quality work on this priceless piece of code. Using Calibre and it's viewer regularly at night (ie. in low light conditions), I was wondering if the global GUI couldn't take advantage of (Py)Qt Stylesheets, and therefore enable "easily" to use darker themes? Dominique |
02-13-2013, 11:37 AM | #2 |
Enthusiast
Posts: 31
Karma: 10
Join Date: Jan 2013
Device: Kobo Libra 2 & Aura HD, Cybook Muse
|
This post (and the related screenshots) would helpfully illustrate my request:
[Release] Qt dark orange stylesheet Thanks |
Advert | |
|
02-13-2013, 12:39 PM | #3 |
creator of calibre
Posts: 43,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
If you wish to create a dark theme for the actual text in the viewer use the viewer preferences to do so. As for GUI styling Qt will use whatever colors you have set at the system level. So switch your system theme to dark and restart calibre, and you should see dark colors.
|
02-14-2013, 04:34 AM | #4 |
Enthusiast
Posts: 31
Karma: 10
Join Date: Jan 2013
Device: Kobo Libra 2 & Aura HD, Cybook Muse
|
You're right, this is the way I would have followed on a computer driven by a "real" system (no troll here), but I'm stuck on a windows 7 where I can't have any decent system theming without huge modifications in the system binaries themselves.
I was just wondering if Calibre and it's viewer couldn't fetch itself and set a custom Qt stylesheet file lying in the user preferences datas, or even if this could be done from a plugin (whereas being not so familiar with Python and Qt, I could write a plugins for this). Regards |
02-14-2013, 07:09 AM | #5 |
creator of calibre
Posts: 43,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
calibre will use the system colors you set in windows as well.
|
Advert | |
|
02-18-2013, 11:10 AM | #6 | |
Enthusiast
Posts: 31
Karma: 10
Join Date: Jan 2013
Device: Kobo Libra 2 & Aura HD, Cybook Muse
|
Quote:
I was just asking to have enabled in Calibre and its viewer the access point provided by Qt to customize the default look'n feel. Nothing more. |
|
02-18-2013, 02:23 PM | #7 |
creator of calibre
Posts: 43,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Feel free to run calibre from source and add the one line thats needed to load a stylesheet. Instructions are here: http://manual.calibre-ebook.com/develop.html
|
03-01-2013, 10:53 AM | #8 |
Enthusiast
Posts: 31
Karma: 10
Join Date: Jan 2013
Device: Kobo Libra 2 & Aura HD, Cybook Muse
|
Here's my code source tweaks made on 0.9.20 enabling a "gui.qss" stylesheet stored in the configuration directory.
I'm posting that here as installing and using Bazaar would be a real overkill for such a small modification. Basically, I just had to modify gui2\mainwindow.py as below: Code:
(11) pyqtSignal, QObject) (12) from calibre.utils.config import OptionParser (13) from calibre.gui2 import error_dialog (14) from calibre import prints (15) (16) # <DFaure> (17) import os (18) from PyQt4.QtCore import (QFile, QString) (19) from calibre.constants import config_dir (20) from calibre.gui2 import info_dialog (21) # </Dfaure> (22) (23) def option_parser(usage='''\ (24) Usage: %prog [options] (25) (26) Launch the Graphical User Interface Code:
(104) quit_action.setMenuRole(QAction.QuitRole) (105) return preferences_action, quit_action (106) (107) def __init__(self, opts, parent=None, disable_automatic_gc=False): (108) QMainWindow.__init__(self, parent) (109) # <DFaure> (110) styleFile = os.path.join(config_dir, 'gui.qss') (111) if QFile.exists(styleFile): (112) styleSheetStr = open(styleFile, 'r').read() (113) self.setStyleSheet(styleSheetStr) (114) # </DFaure> (115) if disable_automatic_gc: (116) self._gc = GarbageCollector(self, debug=False) (117) (118) def unhandled_exception(self, type, value, tb): (119) if type == KeyboardInterrupt: Regards |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Which GUI library is used in latest Calibre? | klonuo | Calibre | 8 | 03-04-2012 11:26 PM |
how to display book's id in Calibre GUI? | jokermania | Calibre | 1 | 12-22-2011 04:36 AM |
starting calibre to do only jobs (no gui) | sosimple | Calibre | 7 | 05-27-2011 02:56 AM |
Calibre GUI is shown Right to Left | nimrodz | Calibre | 2 | 02-04-2011 01:25 PM |
Calibre GUI crash on convert | aapezzuto | Calibre | 1 | 08-02-2008 06:39 PM |