From 6a46395614bf89a8b69fd2b7edb9503bd8f16ceb Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Sat, 25 Jan 2025 17:08:01 +0100 Subject: [PATCH] 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. Pick-to: 6.9 6.8 Task-number: QTBUG-132433 Change-Id: I4df1f046690d1aa9b07fc538441d6ea50d0216ce Reviewed-by: Wladimir Leuschner --- .../styles/modernwindows/qwindows11style.cpp | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/src/plugins/styles/modernwindows/qwindows11style.cpp b/src/plugins/styles/modernwindows/qwindows11style.cpp index fbcbff2b483..24e462c54d7 100644 --- a/src/plugins/styles/modernwindows/qwindows11style.cpp +++ b/src/plugins/styles/modernwindows/qwindows11style.cpp @@ -2203,23 +2203,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(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(widget) && !qobject_cast(widget)) { QPalette pal = widget->palette(); pal.setColor(QPalette::Base, pal.window().color());