Windows11Style: don't modify palette for buttons in polish()
There is no need to screw up the palette of buttons in polish() - the colors are not honored at all. Task-number: QTBUG-132433 Change-Id: I4df1f046690d1aa9b07fc538441d6ea50d0216ce Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io> (cherry picked from commit 6a46395614bf89a8b69fd2b7edb9503bd8f16ceb) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 0d36941a78483d715849cb9bbe1b57ad31dd3eee)
This commit is contained in:
parent
da3068fbfd
commit
2928376e05
@ -2163,23 +2163,6 @@ void QWindows11Style::polish(QWidget* widget)
|
||||
pal.setColor(QPalette::ButtonText, pal.text().color());
|
||||
pal.setColor(QPalette::BrightText, pal.text().color());
|
||||
widget->setPalette(pal);
|
||||
} else if (widget->inherits("QAbstractButton") || widget->inherits("QToolButton")) {
|
||||
widget->setAutoFillBackground(false);
|
||||
auto pal = widget->palette();
|
||||
if (QPushButton *btn = qobject_cast<QPushButton*>(widget)) {
|
||||
if (btn->isFlat() && !pal.isBrushSet(QPalette::Active, QPalette::Button))
|
||||
pal.setColor(QPalette::Active, QPalette::Button, pal.window().color());
|
||||
}
|
||||
if (colorSchemeIndex == 0) {
|
||||
pal.setColor(QPalette::Disabled, QPalette::ButtonText, QColor(0x00,0x00,0x00,0x5C));
|
||||
pal.setColor(QPalette::Disabled, QPalette::Button, QColor(0xF9,0xF9,0xF9,0x4D));
|
||||
}
|
||||
else {
|
||||
pal.setColor(QPalette::Disabled, QPalette::ButtonText, QColor(0xFF,0xFF,0xFF,0x87));
|
||||
pal.setColor(QPalette::Disabled, QPalette::Button, QColor(0xFF,0xFF,0xFF,0x6B));
|
||||
}
|
||||
widget->setPalette(pal);
|
||||
|
||||
} else if (qobject_cast<QGraphicsView *>(widget) && !qobject_cast<QTextEdit *>(widget)) {
|
||||
QPalette pal = widget->palette();
|
||||
pal.setColor(QPalette::Base, pal.window().color());
|
||||
|
Loading…
x
Reference in New Issue
Block a user