summary refs log tree commit diff
path: root/src/UserInfoWidget.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/UserInfoWidget.cpp')
-rw-r--r--src/UserInfoWidget.cpp19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/UserInfoWidget.cpp b/src/UserInfoWidget.cpp

index 5345fb2a..19d7478e 100644 --- a/src/UserInfoWidget.cpp +++ b/src/UserInfoWidget.cpp
@@ -52,10 +52,9 @@ UserInfoWidget::UserInfoWidget(QWidget *parent) textLayout_->setSpacing(widgetMargin / 2); textLayout_->setContentsMargins(widgetMargin * 2, widgetMargin, widgetMargin, widgetMargin); - userAvatar_ = new Avatar(this); + userAvatar_ = new Avatar(this, fontHeight * 2.5); userAvatar_->setObjectName("userAvatar"); userAvatar_->setLetter(QChar('?')); - userAvatar_->setSize(fontHeight * 2.5); QFont nameFont; nameFont.setPointSizeF(nameFont.pointSizeF() * 1.1); @@ -135,14 +134,6 @@ UserInfoWidget::reset() } void -UserInfoWidget::setAvatar(const QImage &img) -{ - avatar_image_ = img; - userAvatar_->setImage(img); - update(); -} - -void UserInfoWidget::setDisplayName(const QString &name) { if (name.isEmpty()) @@ -160,6 +151,14 @@ UserInfoWidget::setUserId(const QString &userid) { user_id_ = userid; userIdLabel_->setText(userid); + update(); +} + +void +UserInfoWidget::setAvatar(const QString &url) +{ + userAvatar_->setImage(url); + update(); } void