Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 09-26-2017, 01:24 PM   #1
bookivore
Member
bookivore began at the beginning.
 
Posts: 13
Karma: 10
Join Date: Sep 2017
Device: laptop
ui colors; fonts under Openbox - qtconfig has no effect ALMOST SOLVED

Under a very light weight Ubuntu 16.04 built from the mini.iso, with Openbox (rather like Lubuntu on Atkins and Amphetamines), qtconfig Version 4.8.7 doesn't affect the ui colors of Sigil. Right now, it has a BDSM/KKK theme - 50 shades of gray & a lot of white. With microscopic fonts in the ui. How can I change this?

This is NOT about adjusting the way the resulting epub looks when opened in a reader - this is about how the text looks in "book view" in Sigil and how the menus of Sigil itself look. As is, it's nearly impossible for me to use. At the very least I want to reverse fg/bg in the book view of the text & increase the font size in the Sigil menus. Is it possible, or if not, can someone recommend a better editor?

Last edited by bookivore; 09-27-2017 at 01:10 PM. Reason: Marking solved.
bookivore is offline   Reply With Quote
Old 09-26-2017, 01:42 PM   #2
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,584
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
You can customize the appearance of the GUI with a custom qt_styles.qss Qt stylesheet.
If a file called "qt_styles.qss" exists in the Sigil Preferences Folder (ie. sits beside sigil.ini), and is readable, Sigil will try to load it as its stylesheet.

You can also customize fonts via Edit > Preferences > Appearance > Fonts/Colors.
Doitsu is offline   Reply With Quote
Advert
Old 09-26-2017, 04:10 PM   #3
bookivore
Member
bookivore began at the beginning.
 
Posts: 13
Karma: 10
Join Date: Sep 2017
Device: laptop
Thanks.
Quote:
Originally Posted by Doitsu View Post
. . . exists in the Sigil Preferences Folder (ie. sits beside sigil.ini)
No such folder & no such file on my system.

Quote:
Originally Posted by Doitsu View Post
You can also customize fonts via Edit > Preferences > Appearance > Fonts/Colors.
Mea culpa. I should have said that I tried that of course. Options are there. I can reset them and the settings are saved but they have no effect.

This is Sigil 0.9.5, which is the latest in the 16.04 repo. Some multiplatform programs do use ini files in the linux versions, but it's more common in older Windows programs. Anyway, there is no sigil config directory anywhere. I searched the entire filesystem from / down for files, including directories, with names containing the string "sigil" or the string "Sigil".

So is this a bug?

Last edited by bookivore; 09-26-2017 at 04:14 PM.
bookivore is offline   Reply With Quote
Old 09-26-2017, 04:16 PM   #4
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,584
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by bookivore View Post
Thanks.
No such folder & no such file on my system.
Select Edit > Preferences > Open Preferences Location.

It's usually in the home folder. For example:

Code:
/home/user/.local/share/sigil-ebook/sigil/
Doitsu is offline   Reply With Quote
Old 09-26-2017, 04:31 PM   #5
bookivore
Member
bookivore began at the beginning.
 
Posts: 13
Karma: 10
Join Date: Sep 2017
Device: laptop
Quote:
Originally Posted by Doitsu View Post
Select Edit > Preferences > Open Preferences Location.

It's usually in the home folder. For example:

Code:
/home/user/.local/share/sigil-ebook/sigil/
Ahh. I'm an idiot. Manually I just checked /home/user/, /home/user/.config, and /root/ & used gnome-file-search for the whole tree. I forgot gnome-file-search ignores hidden directories. OK, now I know where to tinker.

Thanks again.
bookivore is offline   Reply With Quote
Advert
Old 09-26-2017, 04:56 PM   #6
bookivore
Member
bookivore began at the beginning.
 
Posts: 13
Karma: 10
Join Date: Sep 2017
Device: laptop
OK, I created the file

'/home/me/.local/share/sigil-ebook/sigil/qt_styles.qss'

and tried pasting different examples I found here and there & nothing I've tried seems to have any effect.

If anyone can post an example of such a file that is known to work that changes the fg/bg colors in book view; changes the font size of the menus; changes the bg/fg of the menus - in that order of importance, but any of it would help. If you have a file that you KNOW works, it will at least tell me if I'm barking up the right tree.
bookivore is offline   Reply With Quote
Old 09-26-2017, 05:35 PM   #7
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,548
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
I've never had any trouble changing fonts and text colors on any distro (in CSS/Code or View). But then I compile Sigil myself rather than use the packages from the repos. The repo versions often integrate Sigil with their own qt theming plugins. Perhaps they've broken something there. We don't do any specific platform theme integration in Sigil's base source ourselves. We leave that up to the distros. Too many distros and too many themes/styles to worry about.

The automatic Qt stylesheet support wasn't added to Sigil until v0.9.6. That's why your .qss file is being ignored by the 16.04 supplied 0.9.5. You should, however, still be able to force the use of particular Qt stylesheet by launching Qt applications with an additional command-line-parameter.

Code:
qt_application -stylesheet style.qss

Last edited by DiapDealer; 09-26-2017 at 05:52 PM.
DiapDealer is online now   Reply With Quote
Old 09-26-2017, 06:01 PM   #8
bookivore
Member
bookivore began at the beginning.
 
Posts: 13
Karma: 10
Join Date: Sep 2017
Device: laptop
Well, now. That's progress. Thank you much.

That DOES have effect. I may be a while figuring out how to make it do what I want, but it changed some colors at any rate. If nothing else, with trial and error, I can keep pasting in code until I get closer. I'd still love to see some example files if anyone here is using this approach.

If I don't progress quickly, I'll try compiling a later version.
bookivore is offline   Reply With Quote
Old 09-26-2017, 06:16 PM   #9
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,548
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by bookivore View Post
If I don't progress quickly, I'll try compiling a later version.
That probably won't be necessary. I just realized you were talking about Book View. Sigil's Appearance preference settings only let you change the colors of Code View. Book View only has settings to change the default font-faces. Not for colors. The only way to change to the foreground/background colors of Book View is probably the way you're doing it now. Just know that even if you do figure it out, it may cause problems with EPUBs that attempt to modify those settings.

I'm not going to say changing Book View's background/foreground colors is a bad idea. I'm just going to say there's a reason why we don't offer a convenient way to change those (other than doing it with the EPUB's internal styling).

Last edited by DiapDealer; 09-26-2017 at 06:22 PM.
DiapDealer is online now   Reply With Quote
Old 09-26-2017, 06:51 PM   #10
bookivore
Member
bookivore began at the beginning.
 
Posts: 13
Karma: 10
Join Date: Sep 2017
Device: laptop
Re colors, I've found an answer reasonably satisfactory for me. Compton. From what I've done with it so far, it doesn't appear to be flexible about the details of the color change, but it will invert all the colors of the whole window easily & that is a big improvement for me. A bonus is that it can be used for ANY window running ANYTHING. Cool!!!!!

https://askubuntu.com/questions/1346...for-one-window

Font size in the text wIndow (I should have said this earlier) isn't a problem because it can be zoomed.

What remains is figuring out how to get the font size in the ui menus large enough to read.

[ edited out a mistake here ]

Last edited by bookivore; 09-26-2017 at 07:27 PM.
bookivore is offline   Reply With Quote
Old 09-26-2017, 10:08 PM   #11
bookivore
Member
bookivore began at the beginning.
 
Posts: 13
Karma: 10
Join Date: Sep 2017
Device: laptop
The following works to change the menu headings font and the menu entry font. There are some other font settings I haven't found yet, but those are the important ones. I've also got some commented out font-color code, that somebody with similar problems finding this thread might could use. The problem with looking for examples on the internet is that most people writing on this assume you already speak the language and quote code out of context. Paste it in & it doesn't work any more than a bash script with an unclosed if. This is my entire file. It works, just like this:


QMenu {
/* This works, but I don't need it with compton. Neither "foreground" nor "forground" work */
/* background-color: #ff0000; /* sets background of the menu */
/* The following changes font IN the menu but not the menu heading */
font: 24px;
border: 1px solid black;
}
/* Sets font of menu headings. */
QMenuBar {
font: 24px;
}
QPushButton#evilButton {
background-color: red;
border-style: outset;
border-width: 2px;
border-radius: 10px;
border-color: beige;
font: 24px;
min-width: 10em;
padding: 6px;
}
bookivore is offline   Reply With Quote
Old 09-26-2017, 10:19 PM   #12
bookivore
Member
bookivore began at the beginning.
 
Posts: 13
Karma: 10
Join Date: Sep 2017
Device: laptop
So, to summarize my solution for anybody else with similar desires:

Compton to invert ALL the colors in the window - ui elements, text window, title bar, EVERYTHING. I could probably do better using the qss file if I could find all the right names for all the different parts of the window. But I never found any good list, and this is good enough for me.

The qss file as indicated to change the text size in the menu headings and menu entries.

The zoom control to set the text size in the text window.
bookivore is offline   Reply With Quote
Old 09-27-2017, 12:43 PM   #13
bookivore
Member
bookivore began at the beginning.
 
Posts: 13
Karma: 10
Join Date: Sep 2017
Device: laptop
Trying to do it purely with the stylesheet, without compton, this does everything I want EXCEPT change the foreground color in the main text area. Again, this is the entirety of the file:

/* The "*" affects EVERYTHING for which no explicit rule follows with the 1 exception noted below */
* {
background-color: #000000;
color: white; /* Won't affect fg of main text area. Why? */
font: 24px;
border: 1px solid #ffffff;
}
bookivore is offline   Reply With Quote
Old 09-27-2017, 08:17 PM   #14
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,548
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by bookivore View Post
color: white; /* Won't affect fg of main text area. Why? */
There is no one-size-fits-all foreground "color" property for the QPlainTextEdit widget that Book View is based on. Many different portions of text can be many different colors. It's the underyling QTextDocument that provides the colors of the text. That document is created from the rendered (by QtWebKit) html/css of the EPUB currently open.

In short: it's the current epub's html/css that determines what color(s) the text in Book View will be. And it defaults to black text on white background.
DiapDealer is online now   Reply With Quote
Old 09-27-2017, 09:21 PM   #15
bookivore
Member
bookivore began at the beginning.
 
Posts: 13
Karma: 10
Join Date: Sep 2017
Device: laptop
Thanks. So, in short, it can't be done with Sigil - even though setting background color IS respected, setting foreground color is NOT, not even with "! important". I'll make a feature suggestion when I figure out where to post it. Proofing/editing an epub in black on white is just too painful for many people, including me.

For anyone else in the same boat, I suggest making a style.qss that has the opposite colors of what you want (for example #ffff00 for a saturated blue), set the code view colors to black foreground text on white background, set Compton to invert Sigil windows & either turn Compton on at boot, or either manually or with a wrapper script the first time you need it. And on those rare occasions when you DO need to edit an epub with multicolored text, invoke sigil with a different stylesheet or no stylesheet & turn off Compton. It ain't perfect, but it is reasonably good.

Last edited by bookivore; 09-28-2017 at 06:09 PM.
bookivore is offline   Reply With Quote
Reply

Tags
theme


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
The Font Effect. Nexutix General Discussions 84 09-26-2012 10:36 AM
How to add alternate fonts without replacing system fonts.(this time this is a guide) techiemonkey Kindle Developer's Corner 17 09-12-2012 04:55 PM
Effect of MR Promotion, or not? ASparrow Writers' Corner 51 11-26-2010 05:23 PM
Seriously thoughtful The Girl Effect Moejoe Lounge 8 08-23-2009 11:08 AM
The Saramago Effect readingaloud News 7 01-22-2008 02:17 PM


All times are GMT -4. The time now is 09:11 AM.


MobileRead.com is a privately owned, operated and funded community.