fix(desktop): rewrite tray loader with explicit per-platform branches

Three branches now: macOS template (.png + @2x, auto-recolour), Windows
multi-size .ico (DPI auto-pick), Linux 22x22 PNG. Drops the runtime
.resize({16,16}) — pre-rendered assets are at correct platform sizes;
runtime resize re-introduced bicubic blur. Defensive fallback to the
programmatic blurple circle is preserved but should not trigger in
practice now that templates ship populated.
This commit is contained in:
Jannis Braun
2026-04-27 14:38:42 +02:00
parent ff67a792b9
commit bd4a7b073a
+10 -2
View File
@@ -253,12 +253,20 @@ function loadTrayIcon(): Electron.NativeImage {
icon.setTemplateImage(true);
return icon;
}
} else if (process.platform === 'win32') {
// Windows: multi-size .ico — Windows + Electron auto-pick best size for current DPI.
const icoPath = path.join(resourcesDir, 'tray-icon.ico');
const icon = nativeImage.createFromPath(icoPath);
if (!icon.isEmpty()) {
return icon;
}
} else {
// Windows/Linux: colored icon
// Linux: single 22x22 PNG (AppIndicator / StatusNotifier convention).
// No runtime resize — the source is already at correct tray size.
const iconPath = path.join(resourcesDir, 'tray-icon.png');
const icon = nativeImage.createFromPath(iconPath);
if (!icon.isEmpty()) {
return icon.resize({ width: 16, height: 16 });
return icon;
}
}
} catch {