diff --git a/imports/Spectral/Panel/RoomListPanel.qml b/imports/Spectral/Panel/RoomListPanel.qml index 31548d1..4dc084f 100644 --- a/imports/Spectral/Panel/RoomListPanel.qml +++ b/imports/Spectral/Panel/RoomListPanel.qml @@ -795,6 +795,38 @@ Item { wrapMode: Text.NoWrap } } + + Label { + visible: notificationCount > 0 && highlightCount == 0 + color: "white" + text: notificationCount + leftPadding: 12 + rightPadding: 12 + topPadding: 4 + bottomPadding: 4 + font.bold: true + + background: Rectangle { + radius: height / 2 + color: MPalette.lighter + } + } + + Label { + visible: highlightCount > 0 + color: "white" + text: highlightCount + leftPadding: 12 + rightPadding: 12 + topPadding: 4 + bottomPadding: 4 + font.bold: true + + background: Rectangle { + radius: height / 2 + color: MPalette.accent + } + } } RippleEffect { diff --git a/src/roomlistmodel.cpp b/src/roomlistmodel.cpp index 7e9b133..c1e5114 100644 --- a/src/roomlistmodel.cpp +++ b/src/roomlistmodel.cpp @@ -161,6 +161,7 @@ QVariant RoomListModel::data(const QModelIndex& index, int role) const { return RoomType::Normal; } if (role == UnreadCountRole) return room->unreadCount(); + if (role == NotificationCountRole) return room->notificationCount(); if (role == HighlightCountRole) return room->highlightCount(); if (role == LastEventRole) return room->lastEvent(); if (role == LastActiveTimeRole) return room->lastActiveTime(); @@ -195,6 +196,7 @@ QHash RoomListModel::roleNames() const { roles[TopicRole] = "topic"; roles[CategoryRole] = "category"; roles[UnreadCountRole] = "unreadCount"; + roles[NotificationCountRole] = "notificationCount"; roles[HighlightCountRole] = "highlightCount"; roles[LastEventRole] = "lastEvent"; roles[LastActiveTimeRole] = "lastActiveTime"; diff --git a/src/roomlistmodel.h b/src/roomlistmodel.h index 9da486d..d8c56d6 100644 --- a/src/roomlistmodel.h +++ b/src/roomlistmodel.h @@ -35,6 +35,7 @@ class RoomListModel : public QAbstractListModel { TopicRole, CategoryRole, UnreadCountRole, + NotificationCountRole, HighlightCountRole, LastEventRole, LastActiveTimeRole,