Try to reduce memory usage by reusing avatar pixmaps
This commit is contained in:
parent
89015b9f18
commit
52056a79fa
27 changed files with 149 additions and 208 deletions
|
|
@ -114,9 +114,8 @@ UserProfile::UserProfile(QWidget *parent)
|
|||
btnLayout->setSpacing(8);
|
||||
btnLayout->setMargin(0);
|
||||
|
||||
avatar_ = new Avatar(this);
|
||||
avatar_ = new Avatar(this, 128);
|
||||
avatar_->setLetter("X");
|
||||
avatar_->setSize(128);
|
||||
|
||||
QFont font;
|
||||
font.setPointSizeF(font.pointSizeF() * 2);
|
||||
|
|
@ -210,8 +209,7 @@ UserProfile::init(const QString &userId, const QString &roomId)
|
|||
displayNameLabel_->setText(displayName);
|
||||
avatar_->setLetter(utils::firstChar(displayName));
|
||||
|
||||
AvatarProvider::resolve(
|
||||
roomId, userId, this, [this](const QImage &img) { avatar_->setImage(img); });
|
||||
avatar_->setImage(roomId, userId);
|
||||
|
||||
auto localUser = utils::localUser();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue