summary refs log tree commit diff
diff options
context:
space:
mode:
authorredsky17 <joedonofry@gmail.com>2019-01-26 06:03:52 +0000
committerredsky17 <joedonofry@gmail.com>2019-01-26 06:03:52 +0000
commitf869ff5ded0fb9920ade241e877025c609cf0988 (patch)
tree76c57a923de858f9b55dfd03e56b7c81e1de3019
parentUpdate user colors to use Cache vs Utils (diff)
downloadnheko-f869ff5ded0fb9920ade241e877025c609cf0988.tar.xz
Fix inconsistent user color updates.
-rw-r--r--src/timeline/TimelineItem.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/timeline/TimelineItem.cpp b/src/timeline/TimelineItem.cpp
index 11341b92..8e92b168 100644
--- a/src/timeline/TimelineItem.cpp
+++ b/src/timeline/TimelineItem.cpp
@@ -608,17 +608,18 @@ void
 TimelineItem::refreshAuthorColor()
 {
         if (userName_) {
-                QString userColor = Cache::userColor(userName_->text());
+                QString userColor = Cache::userColor(userName_->toolTip());
                 if (userColor.isEmpty()) {
                         // This attempts to refresh this item since it's not drawn
                         // which allows us to get the background color accurately.
                         qApp->style()->polish(this);
                         // generate user's unique color.
                         auto backCol = backgroundColor().name();
-                        userColor = utils::generateContrastingHexColor(userName_->text(), backCol);
-                        Cache::insertUserColor(userName_->text(), userColor);
-                        userName_->setStyleSheet("QLabel { color : " + userColor + "; }");
+                        userColor = utils::generateContrastingHexColor(userName_->toolTip(), backCol);
+                        Cache::insertUserColor(userName_->toolTip(), userColor);
                 }
+                userName_->setStyleSheet("QLabel { color : " + userColor + "; }");
+
         }
 }
 // The username/timestamp is displayed along with the message body.