From f49d715e93afb794146fa28398be91cb2c5ec372 Mon Sep 17 00:00:00 2001 From: Wladimir Leuschner Date: Thu, 9 Nov 2023 13:05:20 +0100 Subject: [PATCH] Fix visible state of QRadioButton in Windows11 style with animations off Change-Id: I870afeb3330fcbe49ce6f16e847af23c3d91b74b Reviewed-by: Friedemann Kleint Reviewed-by: Oliver Wolff --- .../styles/modernwindows/qwindows11style.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/plugins/styles/modernwindows/qwindows11style.cpp b/src/plugins/styles/modernwindows/qwindows11style.cpp index 1e9f6cb0f0..aa7199e5d2 100644 --- a/src/plugins/styles/modernwindows/qwindows11style.cpp +++ b/src/plugins/styles/modernwindows/qwindows11style.cpp @@ -548,6 +548,19 @@ void QWindows11Style::drawPrimitive(PrimitiveElement element, const QStyleOption } } } + } else if (!d->transitionsEnabled() && element == PE_IndicatorRadioButton) { + QObject *styleObject = option->styleObject; // Can be widget or qquickitem + if (styleObject) { + styleObject->setProperty("_q_end_radius",7.0); + if (option->state & State_Sunken) + styleObject->setProperty("_q_end_radius",2.0); + else if (option->state & State_MouseOver && !(option->state & State_On)) + styleObject->setProperty("_q_end_radius",7.0); + else if (option->state & State_MouseOver && (option->state & State_On)) + styleObject->setProperty("_q_end_radius",5.0); + else if (option->state & State_On) + styleObject->setProperty("_q_end_radius",4.0); + } } switch (element) {