On Thu, Sep 11, 2014 at 3:50 AM, Edward K. Ream <edream...@gmail.com> wrote:

Here are some revisions to my middle-of-the-night thoughts.

> 1. Registering updaters is straightforward.

True, but that's far from the entire story.  Two classes must become
involved, both in leoApp.py: the LoadManager class and the
PreviousSettings class.

When saving a .leo file Leo will update settings only if settings
have, in fact, been changed.  This is a fairly hairy process, as the
code in leoApp.py shows. Happily, unlike as in the startup process,
all relevant @settings trees are in loaded commanders, so there is no
need to read any .leo file again.

> The idea is to define a new @settings type, say @style::
>
>     @style <simplified-leo-selector>
>     << simplified stylesheet in the body >>

On second, this is way too elaborate, and will cause confusion.

The simplest thing that could possibly work is::

    @style <descriptive-comment>
    < normal Qt stylesheet, w/o *leading* Python comments >

The problem with the first approach is that it hides important
information, namely the exact Qt selector that is being affected by
the @style node! This is a pretty severe violation of the principle,
explicit is better than implicit.

The parser for @style nodes will remove only leading Python comments
because the '#' character appears in many places in Qt style sheets.

In the new scheme, our example becomes::

@style headlines in edit mode

    # A comment explaining what the QTreeWidget QLineEdit selector means
    # Discussions of typical values, with links to Qt docs.

   QTreeWidget QLineEdit {
        background-color: pink;
            # I also tried red and salmon
        selection-color: white;
        selection-background-color: blue;
    }

As you can see, using Python comments helps a lot.

To repeat, this is the simplest thing that could possibly work, and
imo it suffices.

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 leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.

Reply via email to