From 1b3f0bdefd3aeec2e88547d61250c42d1e780584 Mon Sep 17 00:00:00 2001 From: Andrew <66430340+aandrew-me@users.noreply.github.com> Date: Fri, 23 Dec 2022 21:03:58 +0600 Subject: [PATCH] Fixes for macos --- main.js | 12 +++++++++++- resources/icons/16x16.png | Bin 0 -> 590 bytes 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 resources/icons/16x16.png 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 0000000000000000000000000000000000000000..06a10317926a0e2ecc7a6a01c4ab81857e4bee82 GIT binary patch literal 590 zcmV-U0j5~t@AgHUJ_HiFWlk6Ip_QR9nKMzV>OoYu^2ppql+SKXAkO| zAon8G_4jzK)*Kw4m(>Ojb!&PL>G{s(`Z9AW&ImM?_xmGp6_~8Ps?>q693I`;eb~Pb zP&?in3CH9Nvw?6AQ-}${wEN;JE1qFaMF40Hj?aT8fh-lNWl_*Gh9VJKpiI)#@b7%S zyugwV+8{6+3gMpM&Ka`=I00-R8lX0KDKwVyG0;%yh$TYFd2M_f^ZArW`2RFF8?W-w z5JMQLGOIA_nD-FYjGk3tV)RI@+G`-fi4#sr@GeNRU6_PIkM3ql_dH-V?g6o!w$_Y%6Bwd$KSkev<|6?lo5FrkGL zCuWK%%(ddM{v=-f(~r_y0m6$Qcapf`IQ%RBf|vqj*r$Uu4Gb8*0oMf)v%YhsKEs@f zlPEV|_>%ha)sDzHW7hrmX!bbD-DO&FZ2rveBex}WmC5#=&MQ;T8a3YJqcQm^KoPW+ cwW{m<53j7jL45CbvH$=807*qoM6N<$g2PM+fB*mh literal 0 HcmV?d00001