From 96a90eea258ee0ac8ae080e16ab9812115ced40e Mon Sep 17 00:00:00 2001 From: TestGifts Date: Wed, 3 Feb 2021 12:13:28 +0800 Subject: [PATCH] Update tray.js (#193) --- src/electron/tray.js | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/src/electron/tray.js b/src/electron/tray.js index 1b66e98..d06cfb1 100644 --- a/src/electron/tray.js +++ b/src/electron/tray.js @@ -21,11 +21,24 @@ export function createTray(win) { tray.on("right-click", () => { const contextMenu = Menu.buildFromTemplate([ { - label: "Quit", - click: () => { - app.exit(); + label: "播放/暂停", + click: () => { + win.webContents.send("play"); + }, + }, + { + label: "下一首", + accelerator: "CmdOrCtrl+Right", + click: () => { + win.webContents.send("next"); + }, + }, + { + label: "退出", + click: () => { + app.exit(); + }, }, - }, ]); tray.popUpContextMenu(contextMenu); });