From da190593c8b2739692d69718da91792f35d089e0 Mon Sep 17 00:00:00 2001 From: Konstantinos Sideris Date: Mon, 5 Jun 2017 20:19:20 +0300 Subject: [PATCH] Repaint when the room avatar is received --- include/RoomInfoListItem.h | 1 + src/RoomInfoListItem.cc | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/include/RoomInfoListItem.h b/include/RoomInfoListItem.h index 40a1cbb0..12d5abb1 100644 --- a/include/RoomInfoListItem.h +++ b/include/RoomInfoListItem.h @@ -104,4 +104,5 @@ inline RoomState RoomInfoListItem::state() const inline void RoomInfoListItem::setAvatar(const QImage &img) { roomAvatar_ = QPixmap::fromImage(img.scaled(IconSize, IconSize, Qt::IgnoreAspectRatio, Qt::SmoothTransformation)); + update(); } diff --git a/src/RoomInfoListItem.cc b/src/RoomInfoListItem.cc index 3d4c5355..be1b4133 100644 --- a/src/RoomInfoListItem.cc +++ b/src/RoomInfoListItem.cc @@ -189,13 +189,13 @@ void RoomInfoListItem::paintEvent(QPaintEvent *event) void RoomInfoListItem::updateUnreadMessageCount(int count) { unreadMsgCount_ += count; - repaint(); + update(); } void RoomInfoListItem::clearUnreadMessageCount() { unreadMsgCount_ = 0; - repaint(); + update(); } void RoomInfoListItem::setPressedState(bool state) @@ -212,7 +212,7 @@ void RoomInfoListItem::setPressedState(bool state) void RoomInfoListItem::setState(const RoomState &new_state) { state_ = new_state; - repaint(); + update(); } void RoomInfoListItem::contextMenuEvent(QContextMenuEvent *event)