mirror of
https://github.com/Mastermindzh/tidal-hifi.git
synced 2024-11-22 13:32:42 +01:00
make quit button actually quit app (#123)
This commit is contained in:
parent
82ac5edf22
commit
de97ac8a00
@ -1,4 +1,4 @@
|
|||||||
const { Menu } = require("electron");
|
const { Menu, app } = require("electron");
|
||||||
const { showSettingsWindow } = require("./settings");
|
const { showSettingsWindow } = require("./settings");
|
||||||
const isMac = process.platform === "darwin";
|
const isMac = process.platform === "darwin";
|
||||||
|
|
||||||
@ -10,6 +10,14 @@ const settingsMenuEntry = {
|
|||||||
accelerator: "Control+/",
|
accelerator: "Control+/",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const quitMenuEntry = {
|
||||||
|
label: "Quit",
|
||||||
|
click() {
|
||||||
|
app.exit(0);
|
||||||
|
},
|
||||||
|
accelerator: "Control+Q"
|
||||||
|
};
|
||||||
|
|
||||||
const mainMenu = [
|
const mainMenu = [
|
||||||
...(isMac
|
...(isMac
|
||||||
? [
|
? [
|
||||||
@ -25,7 +33,7 @@ const mainMenu = [
|
|||||||
{ role: "hideothers" },
|
{ role: "hideothers" },
|
||||||
{ role: "unhide" },
|
{ role: "unhide" },
|
||||||
{ type: "separator" },
|
{ type: "separator" },
|
||||||
{ role: "quit" },
|
quitMenuEntry,
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
@ -33,7 +41,7 @@ const mainMenu = [
|
|||||||
// { role: 'fileMenu' }
|
// { role: 'fileMenu' }
|
||||||
{
|
{
|
||||||
label: "File",
|
label: "File",
|
||||||
submenu: [settingsMenuEntry, isMac ? { role: "close" } : { role: "quit" }],
|
submenu: [settingsMenuEntry, isMac ? { role: "close" } : quitMenuEntry],
|
||||||
},
|
},
|
||||||
// { role: 'editMenu' }
|
// { role: 'editMenu' }
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user