Fetch user avatars while browsing the member list

pull/1/head
Konstantinos Sideris 7 years ago
parent 8dd21b1dae
commit 156e1e62a6
  1. 8
      include/dialogs/MemberList.hpp
  2. 5
      include/dialogs/ReadReceipts.h
  3. 7
      src/dialogs/MemberList.cpp

@ -45,9 +45,15 @@ public slots:
protected:
void paintEvent(QPaintEvent *event) override;
void moveButtonToBottom();
void hideEvent(QHideEvent *event) override
{
list_->clear();
QFrame::hideEvent(event);
}
private:
void moveButtonToBottom();
QString room_id_;
QLabel *topLabel_;
QListWidget *list_;

@ -44,6 +44,11 @@ public slots:
protected:
void paintEvent(QPaintEvent *event) override;
void hideEvent(QHideEvent *event) override
{
userList_->clear();
QFrame::hideEvent(event);
}
private:
QLabel *topLabel_;

@ -3,6 +3,8 @@
#include <QStyleOption>
#include <QVBoxLayout>
#include "AvatarProvider.h"
#include "ChatPage.h"
#include "Config.h"
#include "FlatButton.h"
#include "Utils.h"
@ -29,6 +31,11 @@ MemberItem::MemberItem(const RoomMember &member, QWidget *parent)
if (!member.avatar.isNull())
avatar_->setImage(member.avatar);
else
AvatarProvider::resolve(ChatPage::instance()->currentRoom(),
member.user_id,
this,
[this](const QImage &img) { avatar_->setImage(img); });
QFont nameFont, idFont;
nameFont.setWeight(65);

Loading…
Cancel
Save