summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swift/QtUI/Roster/DelegateCommons.cpp')
-rw-r--r--Swift/QtUI/Roster/DelegateCommons.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/Swift/QtUI/Roster/DelegateCommons.cpp b/Swift/QtUI/Roster/DelegateCommons.cpp
index c1c1244..21d42ef 100644
--- a/Swift/QtUI/Roster/DelegateCommons.cpp
+++ b/Swift/QtUI/Roster/DelegateCommons.cpp
@@ -6,12 +6,16 @@
#include <Swift/QtUI/Roster/DelegateCommons.h>
+#include <QColor>
#include <QFileInfo>
#include <Swift/QtUI/QtScaledAvatarCache.h>
namespace Swift {
+namespace {
+ const QColor secondLineColor = QColor(160,160,160);
+}
void DelegateCommons::drawElidedText(QPainter* painter, const QRect& region, const QString& text, int flags) {
QString adjustedText(painter->fontMetrics().elidedText(text, Qt::ElideRight, region.width(), Qt::TextShowMnemonic));
@@ -21,7 +25,7 @@ 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();
+ painter->save();
QRect fullRegion(option.rect);
if ( option.state & QStyle::State_Selected ) {
painter->fillRect(fullRegion, option.palette.highlight());
@@ -72,7 +76,7 @@ void DelegateCommons::paintContact(QPainter* painter, const QStyleOptionViewItem
if (!compact) {
painter->setFont(detailFont);
- painter->setPen(QPen(QColor(160,160,160)));
+ painter->setPen(QPen(secondLineColor));
QRect statusTextRegion(textRegion.adjusted(0, nameHeight, 0, 0));
DelegateCommons::drawElidedText(painter, statusTextRegion, statusText);