From b0937302d571de789b403af474a8cdf5491b13ad Mon Sep 17 00:00:00 2001 From: kleuter Date: Thu, 10 Oct 2024 16:17:40 +0200 Subject: [PATCH] fixed https://bugreports.qt.io/browse/QTBUG-98354 --- .../styles/modernwindows/qwindowsvistastyle.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/6.8.0/qtbase/src/plugins/styles/modernwindows/qwindowsvistastyle.cpp b/6.8.0/qtbase/src/plugins/styles/modernwindows/qwindowsvistastyle.cpp index 208420d..1533367 100644 --- a/6.8.0/qtbase/src/plugins/styles/modernwindows/qwindowsvistastyle.cpp +++ b/6.8.0/qtbase/src/plugins/styles/modernwindows/qwindowsvistastyle.cpp @@ -52,6 +52,14 @@ static const int windowsRightBorder = 15; // right border on windows # define CMDLGS_DISABLED 4 #endif +namespace QOSWorkaround { + // Due to a mingw bug being confused by static constexpr variables in an exported class, + // we cannot use QOperatingSystemVersion::Windows11 in libraries outside of QtCore. + // ### TODO Remove this when that problem is fixed. + static constexpr QOperatingSystemVersionBase Windows11 { QOperatingSystemVersionBase::Windows, + 10, 0, 22000 }; +} + // QWindowsVistaStylePrivate ------------------------------------------------------------------------- // Static initializations QVarLengthFlatMap QWindowsVistaStylePrivate::m_vistaTreeViewHelpers; @@ -2911,6 +2919,10 @@ void QWindowsVistaStyle::drawControl(ControlElement element, const QStyleOption theme.stateId = bullet ? MC_BULLETNORMAL: MC_CHECKMARKNORMAL; d->drawBackground(theme); } + else if (QOperatingSystemVersion::current() >= QOSWorkaround::Windows11 + && !act) { + painter->fillRect(checkRect, menuitem->palette.highlight().color().lighter(200)); + } } if (!menuitem->icon.isNull()) {