Quote:
Originally Posted by KevinH
Sigil master now has my first shot at adapting BeckEbook's approach to allow cycling through custom css stylesheets for Preview.
A few notes, the actual implementation had to be changed slightly:
1. Because file access and especially QFileInfo is painfully slow and because Preview needs to reload automatically many many times (so loading speed is very important), the building of the alternative custom urls is done in MainWindow once when Sigil is first opened.
So if you manually create a
"custom_preview_style.css"
or
"custom_preview_style_alt.css";
file after Sigil is open (ie behind Sigil's back so to speak) you will have to open a new MainWindow in order to activate the new css file in Preview.
2. Right now if there are no custom css style files, the icon is greyed out (that action is not enabled) but visually I can not see that in my testing so we probably need to handle that in a different way so when it is disabled it is more visually detectable.
3. The second css file name is based on _alt_ and not _invert_ as technically it can be used for other purposes.
|
Many thanks Kevin. If you can post a link for a beta version, I could start updating the Sigil User Guide with these new pieces.
Quote:
So please everyone thank BeckyEbook for her ingenious approach for implementing this requested feature and her wonderful svg icons!
|
Indeed! Thank you very much Becky for your hard work in order this feature is available.
Quote:
Feedback and ideas for improvements especially on when the button is disabled welcome.
|
I don't know if this is asking too much. Would it be possible that when the new icon is pressed (like one must press the icon for "Run Automate List"), a contextual menu appears so the associated .css stylesheet is open to edit it? If it take too much work, forget this, since as Becky said me, if I have open the .css before starting Sigil, the changes I make will be reflected in Preview Panel.