From 64feb3327e4bc3d3cf5802ded54ea8a06b86a92b Mon Sep 17 00:00:00 2001 From: kim131 <1035828775@qq.com> Date: Fri, 8 Jan 2021 14:49:45 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=A2=E6=88=B7=E7=AB=AF=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=20=E7=BC=A9=E5=B0=8F=E6=94=BE=E5=A4=A7=E5=85=B3=E9=97=AD?= =?UTF-8?q?=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/index.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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(); +}); /** * 项目中的文件上传 */