fix(macos): tray icon size

This commit is contained in:
l 2025-10-10 19:24:53 +03:00
parent b1715f4323
commit 5eecab5943
1 changed files with 13 additions and 2 deletions

View File

@ -8,12 +8,23 @@ import { mainWindow, quitApp } from "./window";
// internal tray state
let tray: Tray = null;
// load the tray icon
const trayIcon = nativeImage.createFromDataURL(trayIconAsset);
// Create and resize tray icon for macOS
function createTrayIcon() {
const image = nativeImage.createFromDataURL(trayIconAsset);
// Resize to a sane size for macOS (about 20px)
const resized = image.resize({ width: 20, height: 20 });
// Mark as template image so it adapts to dark/light mode
resized.setTemplateImage(true);
return resized;
}
// trayIcon.setTemplateImage(true);
export function initTray() {
const trayIcon = createTrayIcon();
tray = new Tray(trayIcon);
updateTrayMenu();
tray.setToolTip("Stoat for Desktop");