summary refs log tree commit diff
path: root/include
diff options
context:
space:
mode:
authorKonstantinos Sideris <sideris.konstantin@gmail.com>2017-04-15 19:04:02 +0300
committerKonstantinos Sideris <sideris.konstantin@gmail.com>2017-04-15 19:04:02 +0300
commite1d48367f8ccb83fc1fcdaee899e5bf4f8ac2669 (patch)
treeae84a8e5f6d1208d5cbf7a05c6e8ab2eaf322c48 /include
parentMove the main window to the center (diff)
downloadnheko-e1d48367f8ccb83fc1fcdaee899e5bf4f8ac2669.tar.xz
Show the unread message count on the window title
Diffstat (limited to 'include')
-rw-r--r--include/ChatPage.h2
-rw-r--r--include/RoomInfoListItem.h6
-rw-r--r--include/RoomList.h3
3 files changed, 11 insertions, 0 deletions
diff --git a/include/ChatPage.h b/include/ChatPage.h

index fd0b63dc..182dca3a 100644 --- a/include/ChatPage.h +++ b/include/ChatPage.h
@@ -48,8 +48,10 @@ public: signals: void close(); + void changeWindowTitle(const QString &msg); private slots: + void showUnreadMessageNotification(int count); void updateTopBarAvatar(const QString &roomid, const QPixmap &img); void updateOwnProfileInfo(const QUrl &avatar_url, const QString &display_name); void setOwnAvatar(const QPixmap &img); diff --git a/include/RoomInfoListItem.h b/include/RoomInfoListItem.h
index 24e84bd3..5c403dc3 100644 --- a/include/RoomInfoListItem.h +++ b/include/RoomInfoListItem.h
@@ -42,6 +42,7 @@ public: inline bool isPressed(); inline RoomInfo info(); inline void setAvatar(const QImage &avatar_image); + inline int unreadMessageCount(); signals: void clicked(const RoomInfo &info_); @@ -82,6 +83,11 @@ private: int unread_msg_count_; }; +inline int RoomInfoListItem::unreadMessageCount() +{ + return unread_msg_count_; +} + inline bool RoomInfoListItem::isPressed() { return is_pressed_; diff --git a/include/RoomList.h b/include/RoomList.h
index d6066166..e22f0954 100644 --- a/include/RoomList.h +++ b/include/RoomList.h
@@ -48,6 +48,7 @@ public: signals: void roomChanged(const RoomInfo &info); + void totalUnreadMessageCountUpdated(int count); public slots: void updateRoomAvatar(const QString &roomid, const QPixmap &img); @@ -55,6 +56,8 @@ public slots: void updateUnreadMessageCount(const QString &roomid, int count); private: + void calculateUnreadMessageCount(); + Ui::RoomList *ui; QMap<QString, RoomInfoListItem *> rooms_;