getavalon / core

The safe post-production pipeline - https://getavalon.github.io/2.0
MIT License
213 stars 48 forks source link

Maya 2020 - Avalon Loader stylesheet is wrong #487

Closed BigRoy closed 4 years ago

BigRoy commented 4 years ago

What happened?

The Loader in Maya 2020 seems to have a very different styling, as if Maya now overrides it. I'm not noticing similar differences in other Maya tools, only on the loader.

afbeelding

What did you expect?

This should resemble more the original styling as when run Standalone or like in Maya 2019:

afbeelding

To Reproduce

Open the Loader in Maya 2020.


Reference:

BigRoy commented 4 years ago

I traced it down to this single line of code. Removing this setStyleSheet on the QSplitter preserves the full styling but of course adds back the border around the splitter.

BigRoy commented 4 years ago

Fix: Option 1

This hack seems to work:

        # In Maya 2020 when only setting the QSplitter stylesheet
        # all children lose any of their other styling. As such
        # we force all styling again and then add our override.
        sheet = style.load_stylesheet()
        sheet += "\nQSplitter { border:0px; }"
        split.setStyleSheet(sheet)

Fix: Option 2

Or, we force the Avalon stylesheet to just have a zero border for QSplitter by default, adding the following to style/style.qss:

QSplitter {
    border: 0px;
}

And then removing the explicit override on this QSplitter instance.

QSplitter has no current CSS applied in the style.qss so it would be the first definition for it.


Both seem to work.

The latter seems most trivial and logical, but I am not sure we want to have QSplitter to default to no border.

Any opinions?

BigRoy commented 4 years ago

Fix: Option 3

Another proposed solution is setting a QObject property and let the style/style.qss stylesheet use that:

QSplitter[noborder="true"] {
    border: 0px;
}

And then instead of applying a stylesheet on the QSplitter we just set the property:

split.setProperty("noborder", True)

Of course the name of the property can be anything, like loaderSplitter. So this would potentially be option 3.