Display the avatar for the Wire author

Display the avatar for the Wire author
This commit is contained in:
defnax 2020-04-19 16:09:42 +02:00
parent 519fb01536
commit 70975b30d9
2 changed files with 27 additions and 0 deletions

View File

@ -24,6 +24,7 @@
#include <QBuffer>
#include "WireGroupItem.h"
#include "gui/gxs/GxsIdDetails.h"
#include <algorithm>
#include <iostream>
@ -49,6 +50,16 @@ void WireGroupItem::setup()
label_groupName->setText(QString::fromStdString(mGroup.mMeta.mGroupName));
label_authorId->setId(mGroup.mMeta.mAuthorId);
frame_details->setVisible(false);
RsIdentityDetails idDetails ;
rsIdentity->getIdDetails(mGroup.mMeta.mAuthorId,idDetails);
QPixmap pixmap ;
if(idDetails.mAvatar.mSize == 0 || !GxsIdDetails::loadPixmapFromData(idDetails.mAvatar.mData, idDetails.mAvatar.mSize, pixmap,GxsIdDetails::SMALL))
pixmap = GxsIdDetails::makeDefaultIcon(mGroup.mMeta.mAuthorId,GxsIdDetails::SMALL);
label_avatar->setPixmap(pixmap);
connect(toolButton_show, SIGNAL(clicked()), this, SLOT(show()));
connect(toolButton_subscribe, SIGNAL(clicked()), this, SLOT(subscribe()));

View File

@ -25,6 +25,22 @@
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="label_avatar">
<property name="maximumSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
<property name="text">
<string>Avatar</string>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_groupName">
<property name="text">