On Mon, Oct 24, 2011 at 9:14 AM, ne1uno <[email protected]> wrote:

> is there any way extra options could be passed onto QApplication(sys.args)?

> it's possible if you would be consulting an @data stylesheet node to 
> determine what was active, that would no longer be valid, so I guess you 
> would have to update the internal stylesheet in that case?

A timely set of questions.  Leo will soon do more than what you are
asking directly.

I had not realized that QApplication dealt with sys.argv.  It would
indeed be possible to support some of the Qt arguments, especially the
--stylesheet argument.

Two small notes:

- It would be --stylesheet, not -stylesheet, for compatibility with
Leo's other arguments.

- Supporting --stylesheet would be a "simulation" in the sense that it
would not be passed to the QApplication ctor.  But this is entirely a
behind-the-scenes detail.

There are several ways to generalize the underlying request behind
your question.

1. Imo, it is time to consider adding a typical "startup" file to Leo,
~/leo_config.py, similar to ~/.emacs or ipython_config.py.  This will
make Leo "thicker", that is more professional/standard.

IPython adds lots of bells and whistles to configuration.  Leo
emulates most of them, but .leo_config.py would be a good addition.
Think of .leo_config.py as a lightweight plugin.

leo_config.py should execute after settings have been parsed, but
before plugins have been loaded.  If desired, leo_config.py may
register "start2" event handlers, which execute after all plugins have
been loaded, just before starting the main Qt event loop.

2. Leo commands form a good framework for other solutions to Qt
stylesheet issues.  Consider the following commands::

- qt-stylesheet-set-global-stylesheet
- qt-stylesheet-append-to-global-stylesheet
- qt-stylesheet-set-widget-stylesheet
- qt-stylesheet-append-to-widget-stylesheet

The body text of the presently selected node will contain a Qt
stylesheet.  Leo can probably check the stylesheet and warn about
syntax errors.

The "global-stylesheet" commands will set the application stylesheet;
the "widget-stylesheet" commands would set the stylesheet of the
selected widget, that is, the widget with focus.

Given the interest in stylesheets, I think all these options are worth
doing asap.

Your comments, please.

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