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/Roster
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/Roster')
-rw-r--r--Swift/QtUI/Roster/DelegateCommons.cpp8
-rw-r--r--Swift/QtUI/Roster/RosterModel.cpp4
2 files changed, 8 insertions, 4 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);
diff --git a/Swift/QtUI/Roster/RosterModel.cpp b/Swift/QtUI/Roster/RosterModel.cpp
index 22af6ec..3f77c86 100644
--- a/Swift/QtUI/Roster/RosterModel.cpp
+++ b/Swift/QtUI/Roster/RosterModel.cpp
@@ -146,10 +146,10 @@ QColor RosterModel::getTextColor(RosterItem* item) const {
int color = 0;
if (contact) {
switch (contact->getStatusShow()) {
- case StatusShow::Online: color = 0x000000; break;
+ case StatusShow::Online: color = 0x595959; break;
case StatusShow::Away: color = 0x336699; break;
case StatusShow::XA: color = 0x336699; break;
- case StatusShow::FFC: color = 0x000000; break;
+ case StatusShow::FFC: color = 0x595959; break;
case StatusShow::DND: color = 0x990000; break;
case StatusShow::None: color = 0x7F7F7F;break;
}