On Wed, 29 May 2013 08:51:35 -0500
"Edward K. Ream" <[email protected]> wrote:

> On Wed, May 29, 2013 at 8:34 AM, Edward K. Ream <[email protected]> wrote:
> 
> Haha.  This means that the bg keyword param to sc.createIconButton should
> > be made functional ;-)  I'll try that now.
> >
> 
> Done at rev 5796.  All unit tests pass.  Please report any problems
> immediately.
> 
> 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.  The former
doesn't work, it just produces a lot of 

Could not parse stylesheet of widget 0x6f32b20

because it doesn't specify a target for the style.

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

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.

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.

I prefer this latter approach, and to go with it re-purposing the bg
parameter (which remember was dead wood until 30 minutes ago) to be the
object name.  If some objects get called "light-blue" that won't break
anything.

Cheers -Terry

-- 
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