Terry continues to do excellent work with style sheets. Alas, I often find 
myself confused about them.

Here, I'll summarize the pros and cons of style sheets, and throw out an 
alternative for discussion.

Pros:

- [General] Stylesheets are what Qt supports for styling.  Therefore, if Qt 
can do it, a stylesheet can specify it.

- [Extensible] Presumably, any future additions to Qt styling will be 
supported by Qt stylesheets.

- [Simple code] This is a relative term ;-)

Cons:

- [Fragile] Errors in stylesheets can have global, serious, repercussions.

  Misplace that semicolon?  Trouble!  Forget that C-style comments don't 
nest.  Big trouble!

- [Too big] Stylesheets contain too much. @data 
qt-gui-user-plugin-style-sheet helps.

  But not much.  For example, print-settings just shows the entire 
stylesheet, which is no help at all.

- [Special case] Stylesheets are unlike any other Leo settings.

I ask myself, can we get the pros without the cons?

The general strategy that I would like to discuss here is this:

1. Use "normal" settings for all aspects of appearance covered by the 
existing style sheet: fonts, sizes, colors.

   This is the way Leo used to specify these settings.  Like::

    @font tree-font
    @color headline-background
    @color selected-headline-background
    @color edit-headline-background
    @color edit-headline-selection-background
    ... ETC!!

2. Code in qtGui.py would translate those settings into style sheets.

3. Provide an "escape" stylesheet, perhaps just @data 
qt-gui-user-plugin-style-sheet, that would allow *any* stylesheet tweaks to 
be added on "last".

Yes, this would entail a lot of tedious coding in qtGui.py.  And there 
might even be technical difficulties that wouldn't be easy to solve.

But imo, the present scheme is too difficult for everyone (including me, as 
recent discussions on #leo have shown.)

It seems too much to expect newcomers to Leo to handle stylesheets smoothly.

Your comments, please, Amigos.

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 http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to