Background
=========

The recent border-focus work would never have happened if Terry had
not written the free_layout plugin.  Seeing those bold borders must
have made an impression on my subconscious: the big Aha about colors
is that a border will indicate which pane has focus *much* more
clearly than minute changes in pastel backgrounds for the body pane,
and *much* more subtly than gigantic switches between light and dark
Solarized schemes.

Furthermore, I might never have figured out how to do the borders had
I not studied Terry's code, namely NestedSplitterHandle.splitter_menu.

This code is a really great kludge:  it composes a stylesheet from
whatever stylesheet the widget *already* has, plus a stylesheet entry
that creates or clears the border.

BTW, if there were *any* way to set widget borders without resorting
to stylesheet hacks I would *much* prefer that way.  But to date I
have not found any such way.

Mixed ideas re stylesheets
====================

I have mixed feelings about Qt stylesheets.  On the plus side, a
*single* stylesheet can specify just about all visual settings and
preferences.

On the minus side, syntax errors can invalidate a *lot* of (all?) user
preferences.  Furthermore, Terry's kludge is pretty ugly at the code
level. Some significant part of me prefers individual Leo settings to
one large stylesheet.

However, a stylesheet utility, say qtGui.replaceStylesheet, might be
able to handle many such on-the-fly changes.  I'll certainly write
this utility: it simplify add_border and remove_border significantly,
and it's an example of the DRY (Don't Repeat Yourself) principle.

The question
==========

After these preliminaries, I am considering creating stylesheet
framework for Leo.  Conceptually, the framework is simply a list
containing either

a) stylesheets directly or
b) user options that can easily be translated into stylesheet entries.

The purpose of this framework would be to hide, as much as possible,
the gory details of stylesheet format from the rest of Leo.

Another idea would be to have widget-specific stylesheets.  Say one
for the body pane, one for the outline pane, etc.  The framework would
create the stylesheet selector automatically for the user.  For
example, it can be argued (strongly, imo) that the user has no
business knowing that

    QTextEdit#richTextEdit

refers to Leo's body pane.  This is a pure implementation detail.

What do you usual suspects think about these ideas?

Edward

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/leo-editor?hl=en.

Reply via email to