On Tue, Mar 7, 2017 at 6:14 PM, 'Terry Brown' via leo-editor <
[email protected]> wrote:
Terry, this is a very long reply/post. But I think you will be happy with
it.
I'm not suggesting using the css comment mechanism, just saying I don't
> see how it's different from the @constants approach, although I haven't
> seen the latter, and perhaps the latter's a bit more robust.
>
The css comment mechanism has been disabled for a long time. I see no
reason to bring it back. So all talk of Easter Eggs is moot.
Upon further review, I agree with you that almost nothing should change.
The present system works, and copying the entire @theme tree to the end of
leoSettings.leo also works.
I also agree that what is mostly needed is a reorganization of the various
settings in each @theme tree. But point 4 below is a real change, and it
is absolutely essential, imo. Happily, this change simplifies things for
the user.
The only remaining question is whether there is *ever *a need for a
make-theme script. I think not. No more hidden script. No more @button
make-theme.
Yes, most themes *do* need a customized "default" stylesheet,
@data qt-gui-plugin-style-sheet. But Leo has long had the ability to
compose @data nodes from subtrees. That, all by itself, may suffice. If
not, I'll change StyleSheetManager as needed.
In short, there should be no need for @stylesheet.
I have only tested the new approach with the @theme ekr_dark. I am fairly
confident that all other themes can use the same general approach, with the
addition of defining their own @data qt-gui-plugin-style-sheet.
*Notes*
1. @theme ekr_dark uses the default style sheet *completely unchanged*. As
just discussed, other themes will redefine @data qt-gui-plugin-style-sheet.
2. @theme ekr_dark is organized as follows:
- settings
- style sheet settings
- (clone) syntax coloring settings (common to all themes)
- theme settings
For the first time, it is clear that there are *many *more settings besides
those that affect the style sheet. These all must be copied to
myLeoSettings.leo And, as in Atom, syntax coloring settings are actually a
separate category from theme settings.
I expect to use exactly this organization for all other themes.
3. @theme ekr_dark defines @data qt-gui-*user*-style-sheet. It's short and
simple. It could be replaced by settings, *if they existed*, but using the
user style sheet avoids having to modify the main style sheet.
It would be easy to change the user style sheet after copying it to
leoSettings.leo, so the user style sheet can still be the place for further
tweaks.
4.
I did make an absolutely essential change:
ssm.
expand_css_constants no longer adds comments explaining the source of
substitutions.
At long last,
@-substitutions
can be made safely within comments. Like this:
/* -----
QPushButton {
font-family:
@push-button-font-family;
font-size: @push-button-font-size;
}
----- */
Previously, *this would break the style sheet*! Perhaps worse, the
workaround:
/* -----
QPushButton {
font-family: at-push-button-font-family;
font-size: at-push-button-font-size;
}
----- */
becomes confusing after awhile, when I (or any other dev) has forgotten
the reason for the at-hack and wonders what in the world is going on.
*Summary*
Copying entire @theme nodes to the end of myLeoSettings.leo is simple and
good.
Reorganizing settings within @theme trees will make sense of the complexity.
I'll do whatever is required so that "making" a theme is never needed.
Instead, themes will just redefine @data qt-gui-plugin-style-sheet.
ssm.expand_css_constants no longer inserts css comments. This eliminates a
major source of danger and confusion.
Edward
--
You received this message because you are subscribed to the Google Groups
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.