|
|
@ -21,11 +21,24 @@ export function createTray(win) {
|
|
|
|
tray.on("right-click", () => {
|
|
|
|
tray.on("right-click", () => {
|
|
|
|
const contextMenu = Menu.buildFromTemplate([
|
|
|
|
const contextMenu = Menu.buildFromTemplate([
|
|
|
|
{
|
|
|
|
{
|
|
|
|
label: "Quit",
|
|
|
|
label: "播放/暂停",
|
|
|
|
click: () => {
|
|
|
|
click: () => {
|
|
|
|
app.exit();
|
|
|
|
win.webContents.send("play");
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
label: "下一首",
|
|
|
|
|
|
|
|
accelerator: "CmdOrCtrl+Right",
|
|
|
|
|
|
|
|
click: () => {
|
|
|
|
|
|
|
|
win.webContents.send("next");
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
label: "退出",
|
|
|
|
|
|
|
|
click: () => {
|
|
|
|
|
|
|
|
app.exit();
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
]);
|
|
|
|
]);
|
|
|
|
tray.popUpContextMenu(contextMenu);
|
|
|
|
tray.popUpContextMenu(contextMenu);
|
|
|
|
});
|
|
|
|
});
|
|
|
|