From 7d966a0ed455744b5afcb34612727c0b11fb2c40 Mon Sep 17 00:00:00 2001 From: DaTweety <129504390+DaTweety@users.noreply.github.com> Date: Sat, 17 Oct 2026 20:50:23 +0200 Subject: [PATCH 1/2] Show the logo in the Linux system tray The tray icon was QET::Icons::QETLogo, which comes from QElectroTech's own icon theme bundled in its resources and so carries the theme name "qet". On Linux Qt's StatusNotifierItem then sends only that name, and the panel -- another process, without those resources -- cannot resolve it: KDE Plasma showed an empty slot. Seen on D-Bus as IconName "qet" and no IconPixmap. The tray now gets an icon made of the logo's pixmaps only (16 to 256 px), which the tray sends as pixels. Checked on Plasma: IconName is empty and IconPixmap carries the eight sizes. Co-Authored-By: Claude Opus 5.5 --- sources/qetapp.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/sources/qetapp.cpp b/sources/qetapp.cpp index 0dfcb0bd5..e497ec515 100644 --- a/sources/qetapp.cpp +++ b/sources/qetapp.cpp @@ -3053,7 +3053,18 @@ void QETApp::initSystemTray() // initialization of the systray icon // initialisation de l'icone du systray - m_qsti = new QSystemTrayIcon(QET::Icons::QETLogo, this); + //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. + QIcon tray_icon; + for (int size : {16, 22, 24, 32, 48, 64, 128, 256}) { + const QPixmap pixmap = QET::Icons::QETLogo.pixmap(QSize(size, size)); + if (!pixmap.isNull()) + tray_icon.addPixmap(pixmap); + } + m_qsti = new QSystemTrayIcon(tray_icon.isNull() ? QET::Icons::QETLogo : tray_icon, this); m_qsti -> setToolTip(tr("QElectroTech", "systray icon tooltip")); connect(m_qsti, &QSystemTrayIcon::activated, this, &QETApp::systray); m_qsti -> setContextMenu(menu_systray); From 308cf4b551ddbce07045b7e63f7264d879fe7778 Mon Sep 17 00:00:00 2001 From: DaTweety <129504390+DaTweety@users.noreply.github.com> Date: Sun, 18 Oct 2026 22:57:21 +0200 Subject: [PATCH 2/2] 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 --- sources/qetapp.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/sources/qetapp.cpp b/sources/qetapp.cpp index e497ec515..90523beee 100644 --- a/sources/qetapp.cpp +++ b/sources/qetapp.cpp @@ -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); }