diff options
Diffstat (limited to 'Swift/QtUI/QtRosterHeader.cpp')
-rw-r--r-- | Swift/QtUI/QtRosterHeader.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/Swift/QtUI/QtRosterHeader.cpp b/Swift/QtUI/QtRosterHeader.cpp index fc3d0e6..5c89e2a 100644 --- a/Swift/QtUI/QtRosterHeader.cpp +++ b/Swift/QtUI/QtRosterHeader.cpp @@ -16,6 +16,7 @@ #include "QtStatusWidget.h" #include "Swift/QtUI/QtElidingLabel.h" + namespace Swift { QtRosterHeader::QtRosterHeader(QWidget* parent) : QWidget(parent) { QHBoxLayout* topLayout = new QHBoxLayout(); @@ -26,10 +27,11 @@ QtRosterHeader::QtRosterHeader(QWidget* parent) : QWidget(parent) { setMaximumHeight(50); avatarLabel_ = new QLabel(this); - avatarLabel_->setMinimumSize(40, 40); - avatarLabel_->setMaximumSize(40, 40); + avatarLabel_->setMinimumSize(avatarSize_, avatarSize_); + avatarLabel_->setMaximumSize(avatarSize_, avatarSize_); + avatarLabel_->setAlignment(Qt::AlignCenter); setAvatar(":/icons/avatar.png"); - avatarLabel_->setScaledContents(true); + avatarLabel_->setScaledContents(false); topLayout->addWidget(avatarLabel_); QVBoxLayout* rightLayout = new QVBoxLayout(); @@ -125,11 +127,13 @@ void QtRosterHeader::setAvatar(const QString& path) { qDebug() << "Setting null avatar"; avatar = QIcon(":/icons/avatar.png"); } - avatarLabel_->setPixmap(avatar.pixmap(64, 64)); + avatarLabel_->setPixmap(avatar.pixmap(avatarSize_, avatarSize_)); } //QSize QtRosterHeader::sizeHint() const { // return minimumSizeHint(); //} +const int QtRosterHeader::avatarSize_ = 40; + } |