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>bb10
parent
7a593c8c98
commit
0dedb60385
|
|
@ -161,9 +161,10 @@ QTemporaryFile *QDBusTrayIcon::tempIcon(const QIcon &icon)
|
||||||
}
|
}
|
||||||
if (!necessary)
|
if (!necessary)
|
||||||
return Q_NULLPTR;
|
return Q_NULLPTR;
|
||||||
|
qreal dpr = qGuiApp->devicePixelRatio();
|
||||||
QTemporaryFile *ret = new QTemporaryFile(TempFileTemplate, this);
|
QTemporaryFile *ret = new QTemporaryFile(TempFileTemplate, this);
|
||||||
ret->open();
|
ret->open();
|
||||||
icon.pixmap(QSize(22, 22)).save(ret);
|
icon.pixmap(QSize(22 * dpr, 22 * dpr)).save(ret);
|
||||||
ret->close();
|
ret->close();
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue