mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
fixed user popup not hidpi scaling properly
This commit is contained in:
parent
01e9c723fa
commit
90db7a3995
|
@ -25,6 +25,8 @@ AccountPopupWidget::AccountPopupWidget(std::shared_ptr<Channel> channel)
|
||||||
{
|
{
|
||||||
_ui->setupUi(this);
|
_ui->setupUi(this);
|
||||||
|
|
||||||
|
this->layout()->setSizeConstraint(QLayout::SetFixedSize);
|
||||||
|
|
||||||
setWindowFlags(Qt::FramelessWindowHint);
|
setWindowFlags(Qt::FramelessWindowHint);
|
||||||
this->initAsWindow();
|
this->initAsWindow();
|
||||||
|
|
||||||
|
@ -120,6 +122,8 @@ AccountPopupWidget::AccountPopupWidget(std::shared_ptr<Channel> channel)
|
||||||
|
|
||||||
util::twitch::getUserID(userNickname, this,
|
util::twitch::getUserID(userNickname, this,
|
||||||
[=](const QString &id) { currentTwitchUser->setUserId(id); });
|
[=](const QString &id) { currentTwitchUser->setUserId(id); });
|
||||||
|
|
||||||
|
this->dpiMultiplyerChanged(this->getDpiMultiplier(), this->getDpiMultiplier());
|
||||||
}
|
}
|
||||||
|
|
||||||
void AccountPopupWidget::setName(const QString &name)
|
void AccountPopupWidget::setName(const QString &name)
|
||||||
|
@ -196,6 +200,14 @@ void AccountPopupWidget::updatePermissions()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AccountPopupWidget::dpiMultiplyerChanged(float oldDpi, float newDpi)
|
||||||
|
{
|
||||||
|
this->setStyleSheet(QString("* { font-size: <font-size>px; }")
|
||||||
|
.replace("<font-size>", QString::number((int)(12 * newDpi))));
|
||||||
|
|
||||||
|
this->_ui->lblAvatar->setFixedSize((int)(100 * newDpi), (int)(100 * newDpi));
|
||||||
|
}
|
||||||
|
|
||||||
void AccountPopupWidget::updateButtons(QWidget *layout, bool state)
|
void AccountPopupWidget::updateButtons(QWidget *layout, bool state)
|
||||||
{
|
{
|
||||||
for (auto button : layout->findChildren<QPushButton *>()) {
|
for (auto button : layout->findChildren<QPushButton *>()) {
|
||||||
|
|
|
@ -30,6 +30,9 @@ public:
|
||||||
|
|
||||||
void updatePermissions();
|
void updatePermissions();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual void dpiMultiplyerChanged(float oldDpi, float newDpi) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::AccountPopup *_ui;
|
Ui::AccountPopup *_ui;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue