Save temp icon in higher resolution on HiDPI screens
In case temporary system tray icon is saved to /tmp, scale it according to current devicePixelRatio() instead of using hardcoded 22x22. Change-Id: I2adf2151da3241f4600f8645e323346daabcec4b Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
This commit is contained in:
parent
7a593c8c98
commit
0dedb60385
@ -161,9 +161,10 @@ QTemporaryFile *QDBusTrayIcon::tempIcon(const QIcon &icon)
|
||||
}
|
||||
if (!necessary)
|
||||
return Q_NULLPTR;
|
||||
qreal dpr = qGuiApp->devicePixelRatio();
|
||||
QTemporaryFile *ret = new QTemporaryFile(TempFileTemplate, this);
|
||||
ret->open();
|
||||
icon.pixmap(QSize(22, 22)).save(ret);
|
||||
icon.pixmap(QSize(22 * dpr, 22 * dpr)).save(ret);
|
||||
ret->close();
|
||||
return ret;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user