feat: 添加“收藏”功能至托盘菜单

This commit is contained in:
alger
2025-05-09 19:42:46 +08:00
parent 8ed13d4a85
commit 3c1a144113
4 changed files with 56 additions and 10 deletions
+20
View File
@@ -174,6 +174,18 @@ export function updateTrayMenu(mainWindow: BrowserWindow) {
})
);
// 收藏
menu.append(
new MenuItem({
label: i18n.global.t('common.tray.favorite'),
type: 'normal',
click: () => {
console.log('[Tray] 发送收藏命令 - macOS菜单');
mainWindow.webContents.send('global-shortcut', 'toggleFavorite');
}
})
);
menu.append(
new MenuItem({
label: i18n.global.t('common.tray.next'),
@@ -253,6 +265,14 @@ export function updateTrayMenu(mainWindow: BrowserWindow) {
mainWindow.show();
}
},
{
label: i18n.global.t('common.tray.favorite'),
type: 'normal',
click: () => {
console.log('[Tray] 发送收藏命令 - Windows/Linux菜单');
mainWindow.webContents.send('global-shortcut', 'toggleFavorite');
}
},
{ type: 'separator' },
{
label: i18n.global.t('common.tray.prev'),