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:
Victor Kropp 2016-08-04 16:42:46 +02:00 committed by Shawn Rutledge
parent 7a593c8c98
commit 0dedb60385

View File

@ -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;
}