On Mon, Oct 24, 2011 at 9:00 PM, Terry Brown <[email protected]> wrote:
> I would like users to be able to style Leo according to their own tastes,
> and I think the most flexible way of doing that is using stylesheets.
I agree. See my reply to ne1uno in the thread "leoSettings.leo about to change".
> So yes, I want style manipulations to merge, not replace, other
> styling. But not so much on particular widgets, but in a top level
> stylesheet that controls as much as possible.
Let's do both. Setting stylesheets on particular widgets is just an
implementation detail. For users, we want easy ways of setting the
global stylesheet, or more likely *appending* to the already existing
global stylesheet.
In both cases, the helper functions such as you mention below will
concentrate the unavoidable details in one or two places.
> It seems there are two limitations to Qt stylesheets that interfere
> with this.
> 1) Only one sheet at a particular level (the top level, it this case) We can
> work around this with some sentinel controlled merging of style sheets.
I agree.
> now we can have as many stylesheets as we want per widget, with a simple way
> of merging and replacing them.
Yes.
> 2) Lack of CSS style classes, more usefully thought of as tags. We can work
> around this using in some cases the object name, and in some cases perhaps
> something like:
> QLineEdit *nameEdit = new QLineEdit(this);
> nameEdit->setProperty("style_class", "required_field small_widget");
>
> then
>
> *[style_class~='small_widget'] { font-size: 80%; }
So you are using a behind-the-scenes widget to set up a stylesheet?
I don't understand all the details, but I trust you to write decent
code. Please fire away.
If you think it necessary, feel free to use your incremental update
code in qtBody.setEditorColors and g.app.gui.add/remove_borders.
> This raises questions about how fast Qt styling code is, which I'll
> address in the next post.
I can't imagine that typical use cases will be too slow. Seems like
you are worrying about very fancy stuff--if it is too slow it's the
user's responsibility.
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.