windows tray icon

This commit is contained in:
bubblepipe42
2025-10-02 14:55:06 +08:00
parent e66eff66a7
commit f50ca4fd21
3 changed files with 9 additions and 2 deletions
+7 -1
View File
@@ -146,7 +146,13 @@ function createWindow() {
} }
function createTray() { function createTray() {
tray = new Tray(path.join(__dirname, 'tray-iconTemplate.png')); // Use template icon for macOS (black with transparency, auto-adapts to theme)
// Use colored icon for Windows
const trayIconPath = process.platform === 'darwin'
? path.join(__dirname, 'tray-iconTemplate.png')
: path.join(__dirname, 'tray-icon-windows.png');
tray = new Tray(trayIconPath);
const contextMenu = Menu.buildFromTemplate([ const contextMenu = Menu.buildFromTemplate([
{ {
+2 -1
View File
@@ -39,7 +39,8 @@
"preload.js", "preload.js",
"icon.png", "icon.png",
"tray-iconTemplate.png", "tray-iconTemplate.png",
"tray-iconTemplate@2x.png" "tray-iconTemplate@2x.png",
"tray-icon-windows.png"
], ],
"mac": { "mac": {
"category": "public.app-category.developer-tools", "category": "public.app-category.developer-tools",
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB