From 2928376e05d6acc355b2a175fc7fd964d7f4f1b7 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. Task-number: QTBUG-132433 Change-Id: I4df1f046690d1aa9b07fc538441d6ea50d0216ce Reviewed-by: Wladimir Leuschner (cherry picked from commit 6a46395614bf89a8b69fd2b7edb9503bd8f16ceb) Reviewed-by: Qt Cherry-pick Bot (cherry picked from commit 0d36941a78483d715849cb9bbe1b57ad31dd3eee) --- .../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 98f05ae1ba2..a433d9d7acd 100644 --- a/src/plugins/styles/modernwindows/qwindows11style.cpp +++ b/src/plugins/styles/modernwindows/qwindows11style.cpp @@ -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(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());