Commit de4d38c7 authored by Martin Klapetek's avatar Martin Klapetek

Use QPalette::ColorGroup from the option rather than always QPalette::Active

When the window looses focus, the palette is no longer Active but
Inactive. The option.palette has the correct data, so this just reuses
it.

BUG: 349523
FIXED-IN: 15.04.3
parent 516eb9bd
......@@ -133,9 +133,9 @@ void ContactDelegateCompact::paintContact(QPainter *painter, const QStyleOptionV
const QFontMetrics nameFontMetrics(nameFont);
if (option.state & QStyle::State_Selected) {
painter->setPen(option.palette.color(QPalette::Active, QPalette::HighlightedText));
painter->setPen(option.palette.color(option.palette.currentColorGroup(), QPalette::HighlightedText));
} else {
painter->setPen(option.palette.color(QPalette::Active, QPalette::Text));
painter->setPen(option.palette.color(option.palette.currentColorGroup(), QPalette::Text));
}
painter->setFont(nameFont);
......
......@@ -137,9 +137,9 @@ void ContactDelegate::paintContact(QPainter *painter, const QStyleOptionViewItem
const QFontMetrics nameFontMetrics(QFontDatabase::systemFont(QFontDatabase::GeneralFont));
if (option.state & QStyle::State_Selected) {
painter->setPen(option.palette.color(QPalette::Active, QPalette::HighlightedText));
painter->setPen(option.palette.color(option.palette.currentColorGroup(), QPalette::HighlightedText));
} else {
painter->setPen(option.palette.color(QPalette::Active, QPalette::Text));
painter->setPen(option.palette.color(option.palette.currentColorGroup(), QPalette::Text));
}
painter->drawText(userNameRect,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment