Fixes for macos
This commit is contained in:
parent
55d9517242
commit
1b3f0bdefd
12
main.js
12
main.js
@ -41,6 +41,7 @@ function createWindow() {
|
|||||||
if (!isQuiting && trayEnabled) {
|
if (!isQuiting && trayEnabled) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
win.hide();
|
win.hide();
|
||||||
|
if (app.dock) app.dock.hide();
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
@ -81,6 +82,7 @@ app.whenReady().then(() => {
|
|||||||
label: i18n("Open app"),
|
label: i18n("Open app"),
|
||||||
click() {
|
click() {
|
||||||
win.show();
|
win.show();
|
||||||
|
if (app.dock) app.dock.show()
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -122,12 +124,20 @@ app.whenReady().then(() => {
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
let trayInUse = false;
|
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) => {
|
ipcMain.on("useTray", (_, enabled) => {
|
||||||
if (enabled && !trayInUse) {
|
if (enabled && !trayInUse) {
|
||||||
console.log("Using tray");
|
console.log("Using tray");
|
||||||
trayEnabled = true;
|
trayEnabled = true;
|
||||||
trayInUse = true;
|
trayInUse = true;
|
||||||
tray = new Tray(__dirname + "/assets/images/icon.png");
|
tray = new Tray(icon);
|
||||||
tray.setToolTip("ytDownloader");
|
tray.setToolTip("ytDownloader");
|
||||||
tray.setContextMenu(contextMenu);
|
tray.setContextMenu(contextMenu);
|
||||||
} else if (!enabled) {
|
} else if (!enabled) {
|
||||||
|
BIN
resources/icons/16x16.png
Normal file
BIN
resources/icons/16x16.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 590 B |
Loading…
x
Reference in New Issue
Block a user