UPD: Proper maximize handling

This commit is contained in:
Robert Kossessa
2024-02-07 13:17:21 +01:00
parent c9da0ff990
commit 8868fd3d25
5 changed files with 24 additions and 10 deletions

View File

@@ -25,7 +25,7 @@ const createWindow = () => {
resizable: true,
minWidth: width / 3,
minHeight: height / 3,
maximizable: false,
maximizable: true,
fullscreenable: false,
center: true,
backgroundColor: '#000',
@@ -45,6 +45,12 @@ const createWindow = () => {
mainWindow.on('resize', () => {
mainWindow.webContents.setZoomFactor(zoomFactor * mainWindow.getSize()[0] / width)
})
mainWindow.on('maximize', () => {
mainWindow.webContents.send('electron:maximized')
})
mainWindow.on('unmaximize', () => {
mainWindow.webContents.send('electron:unmaximized')
})
// and load the index.html of the app.
if (MAIN_WINDOW_VITE_DEV_SERVER_URL) {