summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2016-12-08 17:33:55 (GMT)
committerEdwin Mons <edwin.mons@isode.com>2016-12-09 09:09:21 (GMT)
commit864904bcd7931ff7453ecb1de72496e4e3cf9c96 (patch)
tree674fe862754682a34682f1f142204dfe73956b87
parent52b10e51563939db8a19bb9336e3280f198b771e (diff)
downloadswift-864904bcd7931ff7453ecb1de72496e4e3cf9c96.zip
swift-864904bcd7931ff7453ecb1de72496e4e3cf9c96.tar.bz2
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
-rw-r--r--Swift/QtUI/Roster/DelegateCommons.cpp5
1 files changed, 2 insertions, 3 deletions
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));