diff --git a/main.js b/main.js index 09e9873..5671d54 100644 --- a/main.js +++ b/main.js @@ -41,6 +41,7 @@ function createWindow() { if (!isQuiting && trayEnabled) { event.preventDefault(); win.hide(); + if (app.dock) app.dock.hide(); } return false; }); @@ -81,6 +82,7 @@ app.whenReady().then(() => { label: i18n("Open app"), click() { win.show(); + if (app.dock) app.dock.show() }, }, { @@ -122,12 +124,20 @@ app.whenReady().then(() => { ]); let trayInUse = false; + let icon; + if (process.platform == "win32") { + icon = __dirname + "/resources/icon.ico"; + } else if (process.platform == "darwin") { + icon = __dirname + "/resources/icons/16x16.png"; + } else { + icon = __dirname + "/resources/icon.png"; + } ipcMain.on("useTray", (_, enabled) => { if (enabled && !trayInUse) { console.log("Using tray"); trayEnabled = true; trayInUse = true; - tray = new Tray(__dirname + "/assets/images/icon.png"); + tray = new Tray(icon); tray.setToolTip("ytDownloader"); tray.setContextMenu(contextMenu); } else if (!enabled) { diff --git a/resources/icons/16x16.png b/resources/icons/16x16.png new file mode 100644 index 0000000..06a1031 Binary files /dev/null and b/resources/icons/16x16.png differ