From 4185b8d1217d7e298256d9bc1bee6188f5ab208d Mon Sep 17 00:00:00 2001 From: redsky17 Date: Fri, 25 Jan 2019 02:43:54 +0000 Subject: Add unread notification color for user mentioned When user is mentioned (via matrix 'highlight_count'), inactive rooms will use a different color for the notification circle than when only general unread messages exist. --- src/RoomInfoListItem.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/RoomInfoListItem.cpp') diff --git a/src/RoomInfoListItem.cpp b/src/RoomInfoListItem.cpp index fcf5bd72..f17b383c 100644 --- a/src/RoomInfoListItem.cpp +++ b/src/RoomInfoListItem.cpp @@ -101,6 +101,7 @@ RoomInfoListItem::RoomInfoListItem(QString room_id, RoomInfo info, QWidget *pare , roomName_{QString::fromStdString(std::move(info.name))} , isPressed_(false) , unreadMsgCount_(0) + , unreadHighlightedMsgCount_(0) { init(parent); @@ -301,7 +302,11 @@ RoomInfoListItem::paintEvent(QPaintEvent *event) if (unreadMsgCount_ > 0) { QBrush brush; brush.setStyle(Qt::SolidPattern); - brush.setColor(bubbleBgColor()); + if (unreadHighlightedMsgCount_ > 0) { + brush.setColor(mentionedColor()); + } else { + brush.setColor(bubbleBgColor()); + } if (isPressed_) brush.setColor(bubbleFgColor()); @@ -354,9 +359,10 @@ RoomInfoListItem::paintEvent(QPaintEvent *event) } void -RoomInfoListItem::updateUnreadMessageCount(int count) +RoomInfoListItem::updateUnreadMessageCount(int count, int highlightedCount) { - unreadMsgCount_ = count; + unreadMsgCount_ = count; + unreadHighlightedMsgCount_ = highlightedCount; update(); } -- cgit 1.5.1