界面优化,提高颜值方案

This commit is contained in:
2026-07-06 20:30:40 +08:00
parent 5f54a5ab6f
commit 9854f6ec9b
10 changed files with 1012 additions and 755 deletions
+5
View File
@@ -360,6 +360,11 @@ ipcMain.on('myreader:allow-close', (event) => {
win.close()
})
ipcMain.handle('myreader:set-menu-visible', (_evt, visible: boolean): void => {
const menu = visible ? buildMenu() : null
Menu.setApplicationMenu(menu)
})
let pendingOpenPaths: string[] = []
const gotTheLock = app.requestSingleInstanceLock()
+2
View File
@@ -33,6 +33,7 @@ export interface MyReaderApi {
deleteFile: (filePath: string) => Promise<void>
renamePath: (oldPath: string, newName: string) => Promise<{ newPath: string }>
allowClose: () => void
setMenuVisible: (visible: boolean) => Promise<void>
onRequestClose: (handler: () => void) => () => void
onMenuAction: (handler: (action: string) => void) => () => void
onOpenFiles: (handler: (paths: string[]) => void) => () => void
@@ -59,6 +60,7 @@ const api: MyReaderApi = {
allowClose: () => {
ipcRenderer.send('myreader:allow-close')
},
setMenuVisible: (visible: boolean) => ipcRenderer.invoke('myreader:set-menu-visible', visible),
onRequestClose: (handler: () => void) => {
const listener = (): void => {
handler()