QWindowsVistaStyle: Use lighter color for disabled GroupBox label

The default windows theme does return the same color for enabled and
disabled groupboxes. This patch changes the color to
pal.color(QPalette::Disabled, QPalette::ButtonText) in case
GetThemeColor returns the same color for GBS_NORMAL and GBS_DISABLED

Fixes: QTBUG-129979
Change-Id: I4557040017354323593449df596b8e56784c07e0
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit b3971d29c0291b9f69b12000c9158af5e0fb3edf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Wladimir Leuschner 2024-10-14 11:12:58 +02:00 committed by Qt Cherry-pick Bot
parent d815b7d839
commit 93ac15fcdb

View File

@ -4782,6 +4782,9 @@ void QWindowsVistaStyle::polish(QPalette &pal)
d->groupBoxTextColor = qRgb(GetRValue(cref), GetGValue(cref), GetBValue(cref));
GetThemeColor(theme.handle(), BP_GROUPBOX, GBS_DISABLED, TMT_TEXTCOLOR, &cref);
d->groupBoxTextColorDisabled = qRgb(GetRValue(cref), GetGValue(cref), GetBValue(cref));
//Work around Windows API returning the same color for enabled and disabled group boxes
if (d->groupBoxTextColor == d->groupBoxTextColorDisabled)
d->groupBoxTextColorDisabled = pal.color(QPalette::Disabled, QPalette::ButtonText).rgb();
// Where does this color come from?
//GetThemeColor(theme.handle(), TKP_TICS, TSS_NORMAL, TMT_COLOR, &cref);
d->sliderTickColor = qRgb(165, 162, 148);