mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-25 20:48:52 +03:00
remove QFontMEtrics declaration
This commit is contained in:
parent
daf8531e3f
commit
4e8a2d8c9e
2 changed files with 3 additions and 6 deletions
|
@ -162,8 +162,6 @@ LoginPage::LoginPage(QWidget *parent)
|
|||
error_label_->setFont(font);
|
||||
error_label_->setWordWrap(true);
|
||||
|
||||
error_font_metrics_ = new QFontMetrics(font);
|
||||
|
||||
top_layout_->addLayout(top_bar_layout_);
|
||||
top_layout_->addStretch(1);
|
||||
top_layout_->addLayout(logo_layout_);
|
||||
|
@ -192,8 +190,9 @@ LoginPage::LoginPage(QWidget *parent)
|
|||
void
|
||||
LoginPage::loginError(const QString &msg)
|
||||
{
|
||||
int width = error_font_metrics_->boundingRect(msg).width();
|
||||
int height = error_font_metrics_->boundingRect(msg).height();
|
||||
auto rect = QFontMetrics(font()).boundingRect(msg);
|
||||
int width = rect.width();
|
||||
int height = rect.height();
|
||||
error_label_->setFixedHeight(qCeil(width / 200 * height));
|
||||
error_label_->setText(msg);
|
||||
}
|
||||
|
|
|
@ -115,8 +115,6 @@ private:
|
|||
QLabel *error_label_;
|
||||
QLabel *error_matrixid_label_;
|
||||
|
||||
QFontMetrics *error_font_metrics_;
|
||||
|
||||
QHBoxLayout *serverLayout_;
|
||||
QHBoxLayout *matrixidLayout_;
|
||||
LoadingIndicator *spinner_;
|
||||
|
|
Loading…
Reference in a new issue