|
|
@ -21,14 +21,18 @@ export function createTray(win) {
|
|
|
|
const contextMenu = Menu.buildFromTemplate([
|
|
|
|
const contextMenu = Menu.buildFromTemplate([
|
|
|
|
{
|
|
|
|
{
|
|
|
|
label: "播放/暂停",
|
|
|
|
label: "播放/暂停",
|
|
|
|
icon: "src/assets/icons/play.png",
|
|
|
|
icon: nativeImage.createFromPath(
|
|
|
|
|
|
|
|
path.join(__static, "img/icons/play.png")
|
|
|
|
|
|
|
|
),
|
|
|
|
click: () => {
|
|
|
|
click: () => {
|
|
|
|
win.webContents.send("play");
|
|
|
|
win.webContents.send("play");
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
label: "上一首",
|
|
|
|
label: "上一首",
|
|
|
|
icon: "src/assets/icons/left.png",
|
|
|
|
icon: nativeImage.createFromPath(
|
|
|
|
|
|
|
|
path.join(__static, "img/icons/left.png")
|
|
|
|
|
|
|
|
),
|
|
|
|
accelerator: "CmdOrCtrl+Left",
|
|
|
|
accelerator: "CmdOrCtrl+Left",
|
|
|
|
click: () => {
|
|
|
|
click: () => {
|
|
|
|
win.webContents.send("previous");
|
|
|
|
win.webContents.send("previous");
|
|
|
@ -36,7 +40,9 @@ export function createTray(win) {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
label: "下一首",
|
|
|
|
label: "下一首",
|
|
|
|
icon: "src/assets/icons/right.png",
|
|
|
|
icon: nativeImage.createFromPath(
|
|
|
|
|
|
|
|
path.join(__static, "img/icons/right.png")
|
|
|
|
|
|
|
|
),
|
|
|
|
accelerator: "CmdOrCtrl+Right",
|
|
|
|
accelerator: "CmdOrCtrl+Right",
|
|
|
|
click: () => {
|
|
|
|
click: () => {
|
|
|
|
win.webContents.send("next");
|
|
|
|
win.webContents.send("next");
|
|
|
@ -44,7 +50,9 @@ export function createTray(win) {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
label: "循环播放",
|
|
|
|
label: "循环播放",
|
|
|
|
icon: "src/assets/icons/repeat.png",
|
|
|
|
icon: nativeImage.createFromPath(
|
|
|
|
|
|
|
|
path.join(__static, "img/icons/repeat.png")
|
|
|
|
|
|
|
|
),
|
|
|
|
accelerator: "Alt+R",
|
|
|
|
accelerator: "Alt+R",
|
|
|
|
click: () => {
|
|
|
|
click: () => {
|
|
|
|
win.webContents.send("repeat");
|
|
|
|
win.webContents.send("repeat");
|
|
|
@ -52,7 +60,9 @@ export function createTray(win) {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
label: "加入喜欢",
|
|
|
|
label: "加入喜欢",
|
|
|
|
icon: "src/assets/icons/like.png",
|
|
|
|
icon: nativeImage.createFromPath(
|
|
|
|
|
|
|
|
path.join(__static, "img/icons/like.png")
|
|
|
|
|
|
|
|
),
|
|
|
|
accelerator: "CmdOrCtrl+L",
|
|
|
|
accelerator: "CmdOrCtrl+L",
|
|
|
|
click: () => {
|
|
|
|
click: () => {
|
|
|
|
win.webContents.send("like");
|
|
|
|
win.webContents.send("like");
|
|
|
@ -60,7 +70,9 @@ export function createTray(win) {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
label: "退出",
|
|
|
|
label: "退出",
|
|
|
|
icon: "src/assets/icons/exit.png",
|
|
|
|
icon: nativeImage.createFromPath(
|
|
|
|
|
|
|
|
path.join(__static, "img/icons/exit.png")
|
|
|
|
|
|
|
|
),
|
|
|
|
accelerator: "CmdOrCtrl+W",
|
|
|
|
accelerator: "CmdOrCtrl+W",
|
|
|
|
click: () => {
|
|
|
|
click: () => {
|
|
|
|
app.exit();
|
|
|
|
app.exit();
|
|
|
|