Hey Chad,

Must have missed your last question.

The reason you're getting more than you ask for with stylesheets, is
because they override any "QStyle <https://doc.qt.io/qt-5/qstyle.html>"
already in there. A reason some one might use QStyle, as opposed to
stylesheets, is because stylesheets is a high-level wrapper around styles
and doesn't cover everything you could think to do with it.

To get the same look, you'll need to reimplement what they have
accomplished with styles. Odds are, you'll be mostly successful as
stylesheets do cover lots of things. But if unlucky, you'll be unable to
replicate some things. Like how in 2016+ the channels change color based on
whether there is a key on it or not.

You could then look into using styles, but my experience with it is both
short and painful.

Best,
Marcus

On 12 January 2017 at 20:57, fruity <fruityfr...@gmail.com> wrote:

> Hi Chad,
>
> You can do it easily using something like
>
> cmds.colorEditor()
> targetWindows = ['mainWindow', 'graphEditor', etc...]
> if cmds.colorEditor(q=1, result=1):
>     rgbCol = cmds.colorEditor(q=1, rgb=1)
>     uis = cmds.lsUI(windows=1)
>     for ui in uis:
>         if any([t in ui for t in targetWindows]):
>             cmds.window(ui, e=1, bgc=rgbColor)
>
> Or if you want the qt solution, and a better control, what I usually do is
> getting a pointer to the main window and coloring it with a styleSheet,
> like so :
>
> objName = mainWindow.objectName()
> mainWindow.setStyleSheet('#'+objName+'{background-color: rgb(100, 50,
> 100)}')
>
> This way (i.e. by giving the object name of your window in the css), your
> style sheet won't be inherited by all the children !
>
> (Funny, I don't know where you work, but I had the same request from
> animators in my studio a couple of weeks ago ^^)
>
> Le vendredi 2 décembre 2016 17:59:19 UTC-8, Chad_Fox a écrit :
>>
>> Hey, just a quick follow up on this,
>>
>> The script I posted earlier works, but it is also changing the background
>> and text color of attribute text boxes. When an attr is keyed, locked or
>> connected while this stylesheet change is active, the backgrounds are dark
>> grey and text black.
>>
>> Thoughts on why that might be?
>>
>>
>> --
> You received this message because you are subscribed to the Google Groups
> "Python Programming for Autodesk Maya" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to python_inside_maya+unsubscr...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/ms
> gid/python_inside_maya/4e398c05-076e-4113-86d2-f6495d576d43%
> 40googlegroups.com
> <https://groups.google.com/d/msgid/python_inside_maya/4e398c05-076e-4113-86d2-f6495d576d43%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
*Marcus Ottosson*
konstrukt...@gmail.com

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOBC4XmeMC1iyNqxoYcgCp%2Bvc5GRkujeqkOdxy16RvLMWQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to