Show the unread message count on the window title
This commit is contained in:
parent
e02dd2b8c5
commit
e1d48367f8
6 changed files with 41 additions and 1 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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_;
|
||||
|
|
|
|||
|
|
@ -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_;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue