D-Bus tray icons: save temp file with size 22px

Gnome Classic on Ubuntu shows this icon but fails to scale it down.
So if we do not pre-scale the icon, it will be too wide, and cropped.

Change-Id: If8cf98de3672deff77b99b17da5491bd6c45cfdb
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
This commit is contained in:
Shawn Rutledge 2015-02-04 14:55:57 +01:00
parent bf65a58e5a
commit 6389160f04

View File

@ -145,12 +145,8 @@ QTemporaryFile *QDBusTrayIcon::tempIcon(const QIcon &icon)
if (!necessary) if (!necessary)
return Q_NULLPTR; return Q_NULLPTR;
QTemporaryFile *ret = new QTemporaryFile(TempFileTemplate, this); QTemporaryFile *ret = new QTemporaryFile(TempFileTemplate, this);
QSize tempSize;
Q_FOREACH (const QSize &size, icon.availableSizes())
if (size.width() > tempSize.width())
tempSize = size;
ret->open(); ret->open();
icon.pixmap(tempSize).save(ret); icon.pixmap(QSize(22, 22)).save(ret);
ret->close(); ret->close();
return ret; return ret;
} }