From 93ac15fcdbc3936c930b657d76f9752e4ad54726 Mon Sep 17 00:00:00 2001 From: Wladimir Leuschner Date: Mon, 14 Oct 2024 11:12:58 +0200 Subject: [PATCH] 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 (cherry picked from commit b3971d29c0291b9f69b12000c9158af5e0fb3edf) Reviewed-by: Qt Cherry-pick Bot --- src/plugins/styles/modernwindows/qwindowsvistastyle.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/plugins/styles/modernwindows/qwindowsvistastyle.cpp b/src/plugins/styles/modernwindows/qwindowsvistastyle.cpp index a0ea7916232..3be252a20a3 100644 --- a/src/plugins/styles/modernwindows/qwindowsvistastyle.cpp +++ b/src/plugins/styles/modernwindows/qwindowsvistastyle.cpp @@ -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);