mirror of
https://github.com/zhayujie/chatgpt-on-wechat.git
synced 2026-07-17 11:07:11 +08:00
feat(desktop): native desktop enhancements
- Add a minimal application menu with common items and shortcuts: New Chat (Cmd+N), Settings (Cmd+,), Reload, etc. - Add system tray with show window, new chat, and quit; click icon to restore - Add single-instance lock so relaunching focuses the existing window - Implement close-to-tray: closing the window hides it; only a real quit destroys it - Explicitly define Window menu's Close Window bound to Cmd+W / Ctrl+W to reliably trigger hide-to-tray - Listen for menu-action in the renderer to handle menu-triggered new chat / open settings
This commit is contained in:
@@ -24,5 +24,10 @@ contextBridge.exposeInMainWorld('electronAPI', {
|
||||
ipcRenderer.on('window-maximize-changed', (_event, max) => callback(max))
|
||||
},
|
||||
|
||||
// App menu / shortcut actions forwarded from the main process.
|
||||
onMenuAction: (callback: (action: string) => void) => {
|
||||
ipcRenderer.on('menu-action', (_event, action: string) => callback(action))
|
||||
},
|
||||
|
||||
platform: process.platform,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user