Tray icon: each size at device pixel ratio 1, comment indentation

On a HiDPI screen QIcon::pixmap() returns each requested size at the
screen's ratio, so the sizes handed to the tray no longer matched
16 ... 256. Requested at 1.0, as ProjectFileGP in qeticons.cpp does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
DaTweety
2026-10-18 22:57:21 +02:00
parent 7d966a0ed4
commit 308cf4b551
+7 -6
View File
@@ -3053,14 +3053,15 @@ void QETApp::initSystemTray()
// initialization of the systray icon
// initialisation de l'icone du systray
//Pixels only: the logo comes from QElectroTech's own icon theme,
//bundled in its resources, so it carries the theme name "qet".
//On Linux the tray (StatusNotifierItem) then sends only that name,
//which the panel -- another process, without those resources --
//cannot resolve, and the slot stays empty.
//Pixels only: the logo comes from QElectroTech's own icon theme,
//bundled in its resources, so it carries the theme name "qet".
//On Linux the tray (StatusNotifierItem) then sends only that name,
//which the panel -- another process, without those resources --
//cannot resolve, and the slot stays empty. Each size at a device
//pixel ratio of 1, so a HiDPI screen does not double them.
QIcon tray_icon;
for (int size : {16, 22, 24, 32, 48, 64, 128, 256}) {
const QPixmap pixmap = QET::Icons::QETLogo.pixmap(QSize(size, size));
const QPixmap pixmap = QET::Icons::QETLogo.pixmap(QSize(size, size), 1.0);
if (!pixmap.isNull())
tray_icon.addPixmap(pixmap);
}