mirror of
https://github.com/qier222/YesPlayMusic.git
synced 2025-03-05 10:15:26 +08:00
拓展托盘菜单及增加图标
This commit is contained in:
parent
a473df2afc
commit
b9adf9ef7e
@ -22,24 +22,53 @@ export function createTray(win) {
|
|||||||
const contextMenu = Menu.buildFromTemplate([
|
const contextMenu = Menu.buildFromTemplate([
|
||||||
{
|
{
|
||||||
label: "播放/暂停",
|
label: "播放/暂停",
|
||||||
|
icon: "src/icon/play.png",
|
||||||
click: () => {
|
click: () => {
|
||||||
win.webContents.send("play");
|
win.webContents.send("play");
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: "上一首",
|
||||||
|
icon: "src/icon/left.png",
|
||||||
|
accelerator: "CmdOrCtrl+Left",
|
||||||
|
click: () => {
|
||||||
|
win.webContents.send("previous");
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label: "下一首",
|
label: "下一首",
|
||||||
|
icon: "src/icon/right.png",
|
||||||
accelerator: "CmdOrCtrl+Right",
|
accelerator: "CmdOrCtrl+Right",
|
||||||
click: () => {
|
click: () => {
|
||||||
win.webContents.send("next");
|
win.webContents.send("next");
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: "循环播放",
|
||||||
|
icon: "src/icon/repeat.png",
|
||||||
|
accelerator: "Alt+R",
|
||||||
|
click: () => {
|
||||||
|
win.webContents.send("repeat");
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "加入喜欢",
|
||||||
|
icon: "src/icon/like.png",
|
||||||
|
accelerator: "CmdOrCtrl+L",
|
||||||
|
click: () => {
|
||||||
|
win.webContents.send("like");
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label: "退出",
|
label: "退出",
|
||||||
|
icon: "src/icon/exit.png",
|
||||||
|
accelerator: "CmdOrCtrl+W",
|
||||||
click: () => {
|
click: () => {
|
||||||
app.exit();
|
app.exit();
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
tray.popUpContextMenu(contextMenu);
|
tray.popUpContextMenu(contextMenu);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
BIN
src/icon/exit.png
Normal file
BIN
src/icon/exit.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 223 B |
BIN
src/icon/left.png
Normal file
BIN
src/icon/left.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 191 B |
BIN
src/icon/like.png
Normal file
BIN
src/icon/like.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 308 B |
BIN
src/icon/play.png
Normal file
BIN
src/icon/play.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 396 B |
BIN
src/icon/repeat.png
Normal file
BIN
src/icon/repeat.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 344 B |
BIN
src/icon/right.png
Normal file
BIN
src/icon/right.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 218 B |
Loading…
x
Reference in New Issue
Block a user