Remove hardcoded font sizes on the top bars and text input
This commit is contained in:
parent
22d0f50e36
commit
97ca8d0ed1
6 changed files with 42 additions and 17 deletions
|
|
@ -63,4 +63,7 @@ private:
|
|||
FlatButton *send_file_button_;
|
||||
FlatButton *send_message_button_;
|
||||
EmojiPickButton *emoji_button_;
|
||||
|
||||
const float TextFontRatio = 1.1;
|
||||
const float EmojiFontRatio = 1.3;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -68,6 +68,9 @@ private:
|
|||
Avatar *avatar_;
|
||||
|
||||
int buttonSize_;
|
||||
|
||||
const float RoomNameFontRatio = 1.2;
|
||||
const float RoomDescriptionFontRatio = 1;
|
||||
};
|
||||
|
||||
inline void TopRoomBar::updateRoomAvatar(const QImage &avatar_image)
|
||||
|
|
@ -82,10 +85,14 @@ inline void TopRoomBar::updateRoomAvatar(const QIcon &icon)
|
|||
|
||||
inline void TopRoomBar::updateRoomName(const QString &name)
|
||||
{
|
||||
name_label_->setText(name);
|
||||
QString elidedText = QFontMetrics(name_label_->font())
|
||||
.elidedText(name, Qt::ElideRight, width() * 0.8);
|
||||
name_label_->setText(elidedText);
|
||||
}
|
||||
|
||||
inline void TopRoomBar::updateRoomTopic(const QString &topic)
|
||||
{
|
||||
topic_label_->setText(topic);
|
||||
QString elidedText = QFontMetrics(topic_label_->font())
|
||||
.elidedText(topic, Qt::ElideRight, width() * 0.8);
|
||||
topic_label_->setText(elidedText);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -72,4 +72,7 @@ private:
|
|||
LogoutDialog *logoutDialog_;
|
||||
|
||||
int logoutButtonSize_;
|
||||
|
||||
const float DisplayNameFontRatio = 1.3;
|
||||
const float UserIdFontRatio = 1.1;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue