Fix incorrect spacing of settings icons at high DPI (#3698)

Co-authored-by: pajlada <rasmus.karlsson@pajlada.com>
This commit is contained in:
kornes 2022-04-30 10:04:45 +00:00 committed by GitHub
parent 94e4cd2c1d
commit b825493d6e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 5 deletions

View file

@ -11,6 +11,7 @@
- Bugfix: Fixed live notifications for usernames containing uppercase characters. (#3646)
- Bugfix: Fixed certain settings dialogs appearing behind the main window, when `Always on top` was used. (#3679)
- Bugfix: Fixed an issue in the emote picker where an emotes tooltip would not properly disappear. (#3686)
- Bugfix: Fixed incorrect spacing of settings icons at high DPI. (#3698)
- Dev: Use Game Name returned by Get Streams instead of querying it from the Get Games API. (#3662)
## 2.3.5

View file

@ -57,15 +57,17 @@ void SettingsDialogTab::paintEvent(QPaintEvent *)
this->style()->drawPrimitive(QStyle::PE_Widget, &opt, &painter, this);
int a = (this->height() - (20 * this->scale())) / 2;
int iconSize = 20 * this->scale();
int pad = (this->height() - iconSize) / 2;
QPixmap pixmap = this->ui_.icon.pixmap(
QSize(this->height() - a * 2, this->height() - a * 2));
QSize(this->height() - pad * 2, this->height() - pad * 2));
painter.drawPixmap(a, a, pixmap);
painter.drawPixmap(pad, pad, pixmap);
a = a + a + 20 + a;
pad = (3 * pad) + iconSize;
this->style()->drawItemText(&painter, QRect(a, 0, width() - a, height()),
this->style()->drawItemText(&painter,
QRect(pad, 0, width() - pad, height()),
Qt::AlignLeft | Qt::AlignVCenter,
this->palette(), false, this->ui_.labelText);
}