Fix rendering of checkboxes in light mode also broken in Qt 6.10 fusion theme

Apply same workaround as was used for dark mode to light mode as well
This commit is contained in:
Kovid Goyal 2026-01-19 07:56:45 +05:30
parent 5dbdc70fd4
commit d5f3bd1de2
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -320,23 +320,22 @@ void CalibreStyle::drawPrimitive(PrimitiveElement element, const QStyleOption *
}
break; // }}}
case PE_IndicatorCheckBox: // {{{
// Fix color used to draw checkbox outline in dark mode
if (is_color_dark(option->palette.color(QPalette::Window))) {
baseStyle()->drawPrimitive(element, option, painter, widget);
painter->save();
painter->translate(0.5, 0.5);
QRect rect = option->rect;
rect = rect.adjusted(0, 0, -1, -1);
case PE_IndicatorCheckBox: { // {{{
// Fix color used to draw checkbox outline
baseStyle()->drawPrimitive(element, option, painter, widget);
painter->save();
painter->translate(0.5, 0.5);
QRect rect = option->rect;
rect = rect.adjusted(0, 0, -1, -1);
if (option->state & State_HasFocus && option->state & State_KeyboardFocusChange)
painter->setPen(QPen(is_color_dark(option->palette.color(QPalette::Window)) ? Qt::white : Qt::black));
else
painter->setPen(QPen(option->palette.color(QPalette::WindowText)));
if (option->state & State_HasFocus && option->state & State_KeyboardFocusChange)
painter->setPen(QPen(Qt::white));
painter->drawRect(rect);
painter->restore();
return;
}
break; // }}}
painter->drawRect(rect);
painter->restore();
return;
} // }}}
case PE_IndicatorRadioButton: // {{{
// Fix color used to draw radiobutton outline in dark mode