diff options
author | Konstantinos Sideris <sideris.konstantin@gmail.com> | 2017-07-15 17:11:46 +0300 |
---|---|---|
committer | Konstantinos Sideris <sideris.konstantin@gmail.com> | 2017-07-15 17:11:46 +0300 |
commit | 30fb46e25b5a2eaeb66f68c9488c5784ed64190d (patch) | |
tree | 0091ac126af6168907798fc41b150f1bd5942d9f /src/UserInfoWidget.cc | |
parent | 847ae37df2c4f465dbed1c71c1eed1746a9d95e7 (diff) |
Use pixels to specify the font sizes
Basically reverts the last font related commits since pointSize isn't
as reliable as pixelSize.
Also some layout values (margins, spacings) have been moved out to Config.h.
Diffstat (limited to 'src/UserInfoWidget.cc')
-rw-r--r-- | src/UserInfoWidget.cc | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/UserInfoWidget.cc b/src/UserInfoWidget.cc index a8fddcd0..57e2cdd5 100644 --- a/src/UserInfoWidget.cc +++ b/src/UserInfoWidget.cc @@ -18,6 +18,7 @@ #include <QDebug> #include <QTimer> +#include "Config.h" #include "FlatButton.h" #include "MainWindow.h" #include "UserInfoWidget.h" @@ -47,20 +48,19 @@ UserInfoWidget::UserInfoWidget(QWidget *parent) userAvatar_->setBackgroundColor("#f9f9f9"); userAvatar_->setTextColor("#333333"); - QFont font; - font.setBold(true); - font.setPointSize(this->font().pointSize() * DisplayNameFontRatio); + QFont nameFont("Open Sans SemiBold"); + nameFont.setPixelSize(conf::userInfoWidget::fonts::displayName); displayNameLabel_ = new QLabel(this); - displayNameLabel_->setFont(font); + displayNameLabel_->setFont(nameFont); displayNameLabel_->setStyleSheet("padding: 0 9px; color: #171919; margin-bottom: -10px;"); displayNameLabel_->setAlignment(Qt::AlignLeading | Qt::AlignLeft | Qt::AlignTop); - font.setBold(false); - font.setPointSize(this->font().pointSize() * UserIdFontRatio); + QFont useridFont("Open Sans"); + useridFont.setPixelSize(conf::userInfoWidget::fonts::userid); userIdLabel_ = new QLabel(this); - userIdLabel_->setFont(font); + userIdLabel_->setFont(useridFont); userIdLabel_->setStyleSheet("padding: 0 8px 8px 8px; color: #555459;"); userIdLabel_->setAlignment(Qt::AlignLeading | Qt::AlignLeft | Qt::AlignVCenter); @@ -129,7 +129,7 @@ void UserInfoWidget::resizeEvent(QResizeEvent *event) Q_UNUSED(event); if (width() <= ui::sidebar::SmallSize) { - topLayout_->setContentsMargins(0, 0, 10, 0); + topLayout_->setContentsMargins(0, 0, logoutButtonSize_ / 2 - 5 / 2, 0); userAvatar_->hide(); displayNameLabel_->hide(); |