Breeze style disobeys some style options
-
The code in question:
void paintEvent(QPaintEvent *) { if (isHovered) { QPainter p(this); QStyleOptionButton styleOption; styleOption.initFrom(this); isPressed ? styleOption.state = QStyle::State_Sunken : styleOption.state = QStyle::State_Raised; style()->drawControl(QStyle::CE_PushButton, &styleOption, &p, this); } }
What I get with Fusion:
What I get with Breeze (you'll just have to trust that I'm clicking here...):
What's the deal with that? I've noticed that Breeze also does some custom stuff like halfway using the QPalette (sometimes it will use its signature light blue even in places where the "highlight" color role is set differently). Is there another API that I can use to paint my stuff to look like a button, and it would actually work? The widget is not a child of QPushButton or QAbstractButton. Just QWidget.
-
The only way is to either try to fix the style by providing patches to KDE (and hope it gets accepted) or write your own style derived from Breeze.
-
The code in question:
void paintEvent(QPaintEvent *) { if (isHovered) { QPainter p(this); QStyleOptionButton styleOption; styleOption.initFrom(this); isPressed ? styleOption.state = QStyle::State_Sunken : styleOption.state = QStyle::State_Raised; style()->drawControl(QStyle::CE_PushButton, &styleOption, &p, this); } }
What I get with Fusion:
What I get with Breeze (you'll just have to trust that I'm clicking here...):
What's the deal with that? I've noticed that Breeze also does some custom stuff like halfway using the QPalette (sometimes it will use its signature light blue even in places where the "highlight" color role is set differently). Is there another API that I can use to paint my stuff to look like a button, and it would actually work? The widget is not a child of QPushButton or QAbstractButton. Just QWidget.
Breeze also does some custom stuff like halfway using the QPalette (sometimes it will use its signature light blue even in places where the "highlight" color role is set differently).
@Ewan-Green, that's deliberate: Breeze uses
KColorScheme
to supersede theQPalette
. It's because in KDE4, the palette wasn't sufficient. There is an effort to port it to the palette, but I've yet to ascertain whether it's even tracked (beyond, perhaps Union).Irrespective, did you ever report this, or did it remediate itself? If the former, have you the URI?