mirror of
https://github.com/kovidgoyal/calibre.git
synced 2026-03-18 15:37:52 -04:00
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:
parent
5dbdc70fd4
commit
d5f3bd1de2
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user