summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2016-07-29 10:55:58 (GMT)
committerTobias Markmann <tm@ayena.de>2016-08-03 11:22:27 (GMT)
commitc135724a9daa6e3dca7bf75abc9c4cabdc585e88 (patch)
tree1ae192d3715dcc3b85b832f716c25072c0590bf1 /Swift/QtUI/ChatList/ChatListDelegate.cpp
parentcc83a29121707f51a7eb8ff11c7eee7a7a575acf (diff)
downloadswift-c135724a9daa6e3dca7bf75abc9c4cabdc585e88.zip
swift-c135724a9daa6e3dca7bf75abc9c4cabdc585e88.tar.bz2
Draw usernames in contact list in dark gray
It now uses the same dark gray tone as the chat view uses for its text. Moved some constants to named variables for readability. Test-Information: Compact and non-compact contact lists, in the roster and MUC roster and the chats view all show the first line drawn in a dark gray instead of the hard black. Change-Id: Ief36fd4f27d30ace61f04d50e846db571ab84a4e
Diffstat (limited to 'Swift/QtUI/ChatList/ChatListDelegate.cpp')
-rw-r--r--Swift/QtUI/ChatList/ChatListDelegate.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/Swift/QtUI/ChatList/ChatListDelegate.cpp b/Swift/QtUI/ChatList/ChatListDelegate.cpp
index 29eb29a..f818e50 100644
--- a/Swift/QtUI/ChatList/ChatListDelegate.cpp
+++ b/Swift/QtUI/ChatList/ChatListDelegate.cpp
@@ -1,11 +1,12 @@
/*
- * Copyright (c) 2010-2015 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#include <Swift/QtUI/ChatList/ChatListDelegate.h>
+#include <QColor>
#include <QPainter>
#include <QPen>
@@ -18,6 +19,10 @@
namespace Swift {
+namespace {
+ const QColor secondLineColor = QColor(160,160,160);
+}
+
ChatListDelegate::ChatListDelegate(bool compact) : compact_(compact) {
groupDelegate_ = new GroupItemDelegate();
}
@@ -102,7 +107,7 @@ void ChatListDelegate::paintMUC(QPainter* painter, const QStyleOptionViewItem& o
DelegateCommons::drawElidedText(painter, nameRegion, item->data(Qt::DisplayRole).toString());
painter->setFont(common_.detailFont);
- painter->setPen(QPen(QColor(160,160,160)));
+ painter->setPen(QPen(secondLineColor));
QRect detailRegion(textRegion.adjusted(0, nameHeight, 0, 0));
DelegateCommons::drawElidedText(painter, detailRegion, item->data(ChatListMUCItem::DetailTextRole).toString());