Fixed MacOS Menu Icon

Signed-off-by: Ujjwal-Agarwal <ujjwal7648@outlook.com>
This commit is contained in:
Ujjwal-Agarwal 2026-02-14 04:35:33 +05:30
parent 923eccfcfc
commit 8d344626e3
1 changed files with 3 additions and 1 deletions

View File

@ -1,6 +1,6 @@
import { Menu, Tray, nativeImage } from "electron"; import { Menu, Tray, nativeImage } from "electron";
import trayIconAsset from "../../assets/desktop/icon.png?asset"; import trayIconAsset from "../../assets/desktop/iconTemplate.png?asset";
import { version } from "../../package.json"; import { version } from "../../package.json";
import { mainWindow, quitApp } from "./window"; import { mainWindow, quitApp } from "./window";
@ -11,6 +11,8 @@ let tray: Tray = null;
// Create and resize tray icon for macOS // Create and resize tray icon for macOS
function createTrayIcon() { function createTrayIcon() {
const image = nativeImage.createFromDataURL(trayIconAsset); const image = nativeImage.createFromDataURL(trayIconAsset);
console.log("Tray icon asset type:", typeof trayIconAsset);
console.log("Tray icon asset preview:", String(trayIconAsset).slice(0, 50));
const resized = image.resize({ width: 20, height: 20 }); const resized = image.resize({ width: 20, height: 20 });
// Mark as template image so it adapts to dark/light mode // Mark as template image so it adapts to dark/light mode