07-12-2018, 10:19 PM | #1 |
Witchman
Posts: 628
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
|
Adding a Dark Theme to Sigil
I've just added a dark theme to Sigil -- see thumbnail.
If anyone else wants to try doing this then do the following: * Go to Github with this link: QDarkStylesheet * Copy all the css code on the GitHub page. * Using any text editor like Notepad or TextMate create a new file on your desktop called "qt_styles.qss" and paste all the copied code into that new file and save it. * Open Sigil and go to Plugins > Manage Plugins > Open Preferences Location and copy your new "qt_styles.qss" file into that directory. * Restart Sigil. Other dark themes you can try that work on Sigil: DarkOrange Last edited by slowsmile; 07-13-2018 at 10:56 PM. |
07-12-2018, 11:28 PM | #2 |
Member
Posts: 14
Karma: 1064
Join Date: Jul 2018
Device: PC
|
Thanks a bunch. I much prefer dark themes because they are infinitely easier on the eyes. Learned this way back in 1997 when taking a web site design class. I found a Harvard study that showed this very fact. Yet, Microsoft pushed for the "paper" look as to blind us from what they are truly doing behind our monitors... ;-P
rmfr |
Advert | |
|
07-12-2018, 11:45 PM | #3 |
Witchman
Posts: 628
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
|
@arakish...I agree with what you say but don't get too excited because there are problems with the QDarkStyleSheet plugin as you'll discover. I'm currently playing with the qss styles to see if I can lighten the black background slightly in the main tab frame so that the text is more readable in html view and text view on Sigil. I'm also looking for other qss dark themes on the inet that might also work in Sigil. I'll post links to them if I can find any.
Last edited by slowsmile; 07-12-2018 at 11:50 PM. |
07-13-2018, 04:07 AM | #4 | |
null operator (he/him)
Posts: 20,950
Karma: 27620688
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
Ooops: forgot to say thank you. slowsmile I'll wait a bit in the hope that you overcome the glitches and/or find an acceptable alternative. For me, looking at scads of CSS code is a sure-fire anaesthetic. Even if it's front ended with a GUI, as in the calibre editor, I throw up my hands saying "Can't be bothered with this glitz-n-glamour nonsense" BR Last edited by BetterRed; 07-13-2018 at 04:24 AM. |
|
07-13-2018, 09:18 AM | #5 |
Hedge Wizard
Posts: 802
Karma: 19999999
Join Date: May 2011
Location: UK/Philippines
Device: Kobo Touch, Nook Simple
|
Hi @slowsmile
Thanks for the information and making the css availiable. I do not like such a dark screen but I should be able to amend it to one based on soft shades of green. From what I understand green is the easiest colour on the eyes. I will let you know how I get on. |
Advert | |
|
07-13-2018, 11:28 AM | #6 | |
Well trained by Cats
Posts: 30,402
Karma: 58055234
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
The company I worked for, built ~200 'Graphics Workstations' for internal use world wide. They used a Monochrome Display on the desk (the rest sat on the floor) I think a goodly chunk of the Silicon Valley toyed with the idea the Star represented. Apple ran with it. Even the 1 button mouse |
|
07-13-2018, 02:14 PM | #7 |
Groupie
Posts: 171
Karma: 3517858
Join Date: May 2016
Location: Monterrey, Mexico
Device: Samsung Tab-3 7"
|
Thank you for doing this, slowsmile. I've wanted a dark theme for Sigil ever since starting to use it.
One little detail. I seldom use the --element examiner-- (not sure if that's what it's called--the little slide-up window in the preview window), but I happened to be tracking down a little formatting problem yesterday, and mine was still open. That window was not affected by your addition. For those who are now taking this ball and running with it, please share your results with the rest of us. I'm not completely enamored with some of the colors that showed up--but I'm working in daylight right now. I'll check back later, after dark, and see if I like it better. Many thanks! |
07-13-2018, 03:15 PM | #8 |
Grand Sorcerer
Posts: 27,960
Karma: 198500000
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Just so you "themers" all know; the next version of Sigil has added the ability to define a custom user stylesheet that is applied to Preview and Book View (which cannot be styled via the .qss file). Those with the ability to compile Sigil themselves can check it out now. The rest will have to wait (hopefully no longer than the end of July). Just create a file named "custom_preview_style.css" in your Sigil Preferences directory and add your custom css to it. Sigil will load it whenever it launches.
Just remember that you're on your own should an epub's css decide to pick a fight with your custom user css. |
07-13-2018, 07:42 PM | #9 |
Witchman
Posts: 628
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
|
I can confirm what DiapDealer has said. I've been playing around and altering some values in the qss file. I've discovered that it's just not possible to change any styling in Book View which is dim and almost unreadable when you use QDarkStyleSheet. And in HTML View you can only change a few styles for just the book text like background color, foreground color and font styles. But you cannot alter the styling of any of the xml or doctype headers or html tags or anything alse. So this greatly limits what you can actually do to style your document.
See example thumbnail below where I've changed just the background color, text color and some fonts(based on QDarkStyleSheet) in Sigil's main tab frame by altering a couple of style properties in the qt_styles.qss stylesheet. Last edited by slowsmile; 07-13-2018 at 08:05 PM. |
07-13-2018, 08:46 PM | #10 | |
Hedge Wizard
Posts: 802
Karma: 19999999
Join Date: May 2011
Location: UK/Philippines
Device: Kobo Touch, Nook Simple
|
Quote:
Thanks for the info. |
|
07-13-2018, 11:48 PM | #11 |
Member
Posts: 14
Karma: 1064
Join Date: Jul 2018
Device: PC
|
@Slowsmile
Yeah I found those as soon as Sigil was restarted. Easy fix though you go into Edit > Preferences > Appearance. Not that hard. Again, thanks. rmfr |
07-14-2018, 09:41 AM | #12 |
Guru
Posts: 771
Karma: 2297170
Join Date: Jan 2017
Location: Poland
Device: Various
|
@slowsmile
Oh, you forgot about the UI graphics. QSS styles are unfortunately a more complicated matter From the source link (github) you must also copy the "rc" folder to the preferences folder. In Windows you need edit qss file and change all: Code:
:/qss_icons Code:
C:/Users/USERNAME/AppData/Local/sigil-ebook/sigil I can suspect that preparing a perfect dark theme is impossible without the help of Sigil programmers and probably some modifications to the source code. E.g: QTableView is used in Validation Resuls window and in a table with a list of installed plugins. I have no idea how to set the independent text color in both windows, so I used the {color: #666666;}, which looks decent in both places. I set the colors in Code View by setting custom colors (Edit > Preferences > Appearance) I set the colors in Book View and Preview Window by a single-line custom_preview_style.css file Code:
body {background-color: #232629; color: #EFF0F1;} |
07-14-2018, 08:36 PM | #13 |
Witchman
Posts: 628
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
|
@BeckyEBook...Remember that the QDarkStyleSheet qss is only for use within python application code that uses Qt. So, in other words , the qss stylsheet and resources must be properly imported into the application code in order to work properly -- see this link. The easiest way to get this python code is just to download and install the QDarkStyle python module into your python installation from the Python Index using pip as shown here. This also means that you would have to rebuild and recompile Sigil with the Qdarkstyle module to incorporate all of it properly into Sigil.
This QDarkStyleStylesheet cannot therefore be completely and properly added manually to an existing already-built application like Sigil. This also means that adding all the icons, as you have suggested, will have no effect on Sigil's existing icons at all when you manually add and use the qss file. You can check this easily by comparing the icons on your QDarkStyleSheet Sigil version with the icons used in normal Sigil without the stylesheet. There will be no difference between them. So copying all the QDarkStyleSheet icons into the Sigil Preferences directory, as you recommend, will not change any icons when you incorporate this stylesheet into Sigil. And so doing that will have no effect and would be a waste of time. Just copying the stylesheet code and following the instructions above in the first post is all you have to do to install it on your Sigil app. It's not perfect but it's really the simplest way to do it for now. DiapDealer, in his post above, has more or less said the same thing as I have concerning how to manually load the qss stylesheet and has also described what's coming in a future Sigil release. Last edited by slowsmile; 07-14-2018 at 11:35 PM. |
07-15-2018, 05:12 AM | #14 |
Guru
Posts: 771
Karma: 2297170
Join Date: Jan 2017
Location: Poland
Device: Various
|
I think there was a misunderstanding.
I did not mention icons but about user interface elements (arrows, checkboxes etc.) After my fixes, without recompiling Sigil and without installing QDarkStyle – it works. Last edited by BeckyEbook; 07-15-2018 at 07:27 AM. |
07-19-2018, 03:18 PM | #15 | |
Bookmaker & Cat Slave
Posts: 11,482
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
Quote:
Thanks, as always, to you and Kev. Hitch |
|
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Dark theme in Calibre for Windows 10 | albertp007 | Development | 30 | 02-07-2020 01:58 AM |
How to get a dark theme under Windows? | alegriadelarte | Calibre | 1 | 05-15-2018 03:22 PM |
Dark Theme for the main GUI | sanon | Calibre | 2 | 10-23-2017 11:32 PM |
No dark theme possible in Ubuntu 16.04? | Klojum | Calibre | 1 | 06-23-2017 09:55 PM |
Sigil with Dark OS Themes | capidamonte | Sigil | 5 | 06-17-2012 12:32 AM |