mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-08 06:19:05 +08:00
Merge branch 'main' into develop
This commit is contained in:
commit
925b8791d6
@ -40,14 +40,27 @@ export function registerZoomShortcut(mainWindow: BrowserWindow) {
|
|||||||
globalShortcut.unregister('CommandOrControl+0')
|
globalShortcut.unregister('CommandOrControl+0')
|
||||||
}
|
}
|
||||||
|
|
||||||
// 当窗口获得焦点时注册快捷键
|
// Add check for window destruction
|
||||||
mainWindow.on('focus', registerShortcuts)
|
if (mainWindow.isDestroyed()) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// 当窗口失去焦点时注销快捷键
|
// When window gains focus, register shortcuts
|
||||||
mainWindow.on('blur', unregisterShortcuts)
|
mainWindow.on('focus', () => {
|
||||||
|
if (!mainWindow.isDestroyed()) {
|
||||||
|
registerShortcuts()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
// 初始注册(如果窗口已经处于焦点状态)
|
// When window loses focus, unregister shortcuts
|
||||||
if (mainWindow.isFocused()) {
|
mainWindow.on('blur', () => {
|
||||||
|
if (!mainWindow.isDestroyed()) {
|
||||||
|
unregisterShortcuts()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
// Initial registration (if window is already focused)
|
||||||
|
if (!mainWindow.isDestroyed() && mainWindow.isFocused()) {
|
||||||
registerShortcuts()
|
registerShortcuts()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -352,7 +352,7 @@
|
|||||||
"new_topic": "新建话题",
|
"new_topic": "新建话题",
|
||||||
"zoom_in": "放大界面",
|
"zoom_in": "放大界面",
|
||||||
"zoom_out": "缩小界面",
|
"zoom_out": "缩小界面",
|
||||||
"zoom_reset": "置缩放"
|
"zoom_reset": "重置缩放"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"translate": {
|
"translate": {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user