From 864904bcd7931ff7453ecb1de72496e4e3cf9c96 Mon Sep 17 00:00:00 2001 From: Tobias Markmann Date: Thu, 8 Dec 2016 18:33:55 +0100 Subject: Fix overly bright rendering of status text in contact list Instead of adjusting the color lightness for the second line, the new code just draws the second line with 70% opacity. This provides a more consistent and predictable effect. Test-Information: Checked rendering of available, away, and busy contact rendering on macOS 10.12.1 and Windows 10. Change-Id: I417b80bdf8ea01db7a6e0e680b488d6a52c297dd diff --git a/Swift/QtUI/Roster/DelegateCommons.cpp b/Swift/QtUI/Roster/DelegateCommons.cpp index a8dd8a7..e4a2f46 100644 --- a/Swift/QtUI/Roster/DelegateCommons.cpp +++ b/Swift/QtUI/Roster/DelegateCommons.cpp @@ -23,15 +23,14 @@ void DelegateCommons::drawElidedText(QPainter* painter, const QRect& region, con void DelegateCommons::paintContact(QPainter* painter, const QStyleOptionViewItem& option, const QColor& nameColor, const QString& avatarPath, const QIcon& presenceIcon, const QString& name, const QString& statusText, bool isIdle, int unreadCount, bool compact) const { painter->save(); QRect fullRegion(option.rect); - QPen secondLineColor; if ( option.state & QStyle::State_Selected ) { painter->fillRect(fullRegion, option.palette.highlight()); painter->setPen(option.palette.highlightedText().color()); - secondLineColor = painter->pen().color().darker(125); } else { painter->setPen(QPen(nameColor)); - secondLineColor = painter->pen().color().lighter(); } + auto secondLineColor = painter->pen().color(); + secondLineColor.setAlphaF(0.7); QRect presenceIconRegion(QPoint(farLeftMargin, fullRegion.top()), QSize(presenceIconWidth, fullRegion.height() - verticalMargin)); -- cgit v0.10.2-6-g49f6