mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-22 19:08:58 +03:00
Fetch user avatars while browsing the member list
This commit is contained in:
parent
8dd21b1dae
commit
156e1e62a6
3 changed files with 19 additions and 1 deletions
|
@ -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…
Reference in a new issue