mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-19 14:41:24 +08:00
Merge 0eaf95110e into 8ab375161d
This commit is contained in:
commit
4b713ff75e
@ -47,6 +47,7 @@ export enum IpcChannel {
|
||||
App_MacRequestProcessTrust = 'app:mac-request-process-trust',
|
||||
|
||||
App_QuoteToMain = 'app:quote-to-main',
|
||||
App_ShowMainWindow = 'app:show-main-window',
|
||||
App_SetDisableHardwareAcceleration = 'app:set-disable-hardware-acceleration',
|
||||
|
||||
Notification_Send = 'notification:send',
|
||||
|
||||
@ -909,6 +909,7 @@ export function registerIpc(mainWindow: BrowserWindow, app: Electron.App) {
|
||||
SelectionService.registerIpcHandler()
|
||||
|
||||
ipcMain.handle(IpcChannel.App_QuoteToMain, (_, text: string) => windowService.quoteToMainWindow(text))
|
||||
ipcMain.handle(IpcChannel.App_ShowMainWindow, () => windowService.showMainWindow())
|
||||
|
||||
ipcMain.handle(IpcChannel.App_SetDisableHardwareAcceleration, (_, isDisable: boolean) => {
|
||||
configManager.setDisableHardwareAcceleration(isDisable)
|
||||
|
||||
@ -375,15 +375,15 @@ export class WindowService {
|
||||
|
||||
mainWindow.hide()
|
||||
|
||||
//for mac users, should hide dock icon if close to tray
|
||||
if (isMac && isTrayOnClose) {
|
||||
app.dock?.hide()
|
||||
const quickAssistantEnabled = configManager.getEnableQuickAssistant()
|
||||
if (!quickAssistantEnabled) {
|
||||
app.dock?.hide()
|
||||
|
||||
mainWindow.once('show', () => {
|
||||
//restore the window can hide by cmd+h when the window is shown again
|
||||
// https://github.com/electron/electron/pull/47970
|
||||
app.dock?.show()
|
||||
})
|
||||
mainWindow.once('show', () => {
|
||||
app.dock?.show()
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
@ -487,6 +487,7 @@ const api = {
|
||||
}) => ipcRenderer.invoke(IpcChannel.AgentToolPermission_Response, payload)
|
||||
},
|
||||
quoteToMainWindow: (text: string) => ipcRenderer.invoke(IpcChannel.App_QuoteToMain, text),
|
||||
openMainWindow: () => ipcRenderer.invoke(IpcChannel.App_ShowMainWindow),
|
||||
setDisableHardwareAcceleration: (isDisable: boolean) =>
|
||||
ipcRenderer.invoke(IpcChannel.App_SetDisableHardwareAcceleration, isDisable),
|
||||
trace: {
|
||||
|
||||
@ -64,6 +64,16 @@ const Footer: FC<FooterProps> = ({
|
||||
: t('miniwindow.footer.esc_back')
|
||||
})}
|
||||
</Tag>
|
||||
<Tag
|
||||
bordered={false}
|
||||
style={{ cursor: 'pointer' }}
|
||||
className="nodrag"
|
||||
onClick={() => {
|
||||
window.api.openMainWindow()
|
||||
window.api.miniWindow.hide()
|
||||
}}>
|
||||
打开主窗口
|
||||
</Tag>
|
||||
{route === 'home' && !canUseBackspace && (
|
||||
<Tag
|
||||
bordered={false}
|
||||
|
||||
@ -183,6 +183,10 @@ const WindowFooter: FC<FooterProps> = ({
|
||||
</>
|
||||
)}
|
||||
</OpButton>
|
||||
<OpButton onClick={() => window.api?.openMainWindow?.()} $isWindowFocus={isWindowFocus}>
|
||||
<CircleX size={14} className="btn-icon" />
|
||||
打开主窗口
|
||||
</OpButton>
|
||||
{onRegenerate && (
|
||||
<OpButton onClick={handleRegenerate} $isWindowFocus={isWindowFocus} data-hovered={isRegenerateHovered}>
|
||||
<RefreshIcon size={14} className="btn-icon" />
|
||||
|
||||
Loading…
Reference in New Issue
Block a user