On Wed, May 29, 2013 at 9:18 AM, Terry Brown <[email protected]>wrote:


> > The heart of the new code is::
> >
> >     b.button.setStyleSheet("{background-color: %s }" % (bg))
> >
> > not:
> >
> >     b.button.setStyleSheet("QWidget {background-color: %s }" % (bg))
> >
> > This latter code would change to much.
>
> The stylesheet only applies to the widget and its descendants, so the
> latter's fine, although you could use QPushButton perhaps.
>


> Using the fixed QWidget / QPushButton version, I'm getting black
> backgrounded buttons, suggesting color names which Qt doesn't know are
> being used.
>

That happened to me too, which is why I removed the QWidget selector.

>
> Of course hard coded button colors of any type are undesirable, so
> first I would recommend the 'bg' parameter have a new default value of
> None, and that no styling be applied when it is None.
>

The code on the trunk does that.

>
> Then we need either @color @settings for the different button types:
>
>  - the singleton run-script button
>  - the singleton script-button button
>  - buttons created by @button nodes
>  - buttons created by clicking the script-button button
>
> or w.setObjectName() be used to tag those four types at creation to
> make them viable targets for the top level stylesheet.
>

Actually, afaik, the present code works as before, except that the bg param
now works.  If you need more, then fire away.

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?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to