Skip to content

Commit

Permalink
OSDPretty: Respect device pixel ratio
Browse files Browse the repository at this point in the history
  • Loading branch information
jonaski committed Mar 29, 2023
1 parent a2533ed commit bae1b42
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/osd/osdpretty.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,8 @@ void OSDPretty::paintEvent(QPaintEvent*) {
void OSDPretty::SetMessage(const QString &summary, const QString &message, const QImage &image) {

if (!image.isNull()) {
QImage scaled_image = image.scaled(kMaxIconSize, kMaxIconSize, Qt::KeepAspectRatio, Qt::SmoothTransformation);
QImage scaled_image = image.scaled(kMaxIconSize * devicePixelRatioF(), kMaxIconSize * devicePixelRatioF(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
scaled_image.setDevicePixelRatio(devicePixelRatioF());
ui_->icon->setPixmap(QPixmap::fromImage(scaled_image));
ui_->icon->show();
}
Expand Down

0 comments on commit bae1b42

Please sign in to comment.