diff --git a/src/main/index.js b/src/main/index.js index d4193ff..12e2637 100644 --- a/src/main/index.js +++ b/src/main/index.js @@ -102,6 +102,23 @@ app.on('second-instance', (event, commandLine, workingDirectory) => { // code. You can also put them in separate files and require them here. // 监听必要的自定义事件 +// 缩小 放大 暂时关闭窗口 +ipcMain.handle('shrink-browser-window', async (event, args) => { + mainWindow.minimize(); +}); +ipcMain.handle('enlarge-browser-window', async (event, args) => { + mainWindow.maximize(); +}); +ipcMain.handle('unmax-browser-window', async (event, args) => { + mainWindow.unmaximize(); +}); +ipcMain.handle('close-browser-window', async (event, args) => { + mainWindow.close(); +}); +// 判断是否是最大化窗口状态 +ipcMain.handle('is-max-window-now', async (event, args) => { + return mainWindow.isMaximized(); +}); /** * 项目中的文件上传 */