mirror of
https://github.com/dbgate/dbgate
synced 2024-11-07 20:26:23 +00:00
PR #440 - handle on startup
This commit is contained in:
parent
1d8264c935
commit
f2d8dfaf18
@ -154,6 +154,10 @@ ipcMain.on('app-started', async (event, arg) => {
|
|||||||
mainWindow.webContents.send('run-command', runCommandOnLoad);
|
mainWindow.webContents.send('run-command', runCommandOnLoad);
|
||||||
runCommandOnLoad = null;
|
runCommandOnLoad = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (initialConfig['winIsMaximized']) {
|
||||||
|
mainWindow.webContents.send('setIsMaximized', true);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
ipcMain.on('window-action', async (event, arg) => {
|
ipcMain.on('window-action', async (event, arg) => {
|
||||||
if (!mainWindow) {
|
if (!mainWindow) {
|
||||||
@ -166,10 +170,10 @@ ipcMain.on('window-action', async (event, arg) => {
|
|||||||
case 'maximize':
|
case 'maximize':
|
||||||
if (mainWindow.isMaximized()) {
|
if (mainWindow.isMaximized()) {
|
||||||
mainWindow.unmaximize();
|
mainWindow.unmaximize();
|
||||||
mainWindow.webContents.send('maximize', false);
|
mainWindow.webContents.send('setIsMaximized', false);
|
||||||
} else {
|
} else {
|
||||||
mainWindow.maximize();
|
mainWindow.maximize();
|
||||||
mainWindow.webContents.send('maximize', true);
|
mainWindow.webContents.send('setIsMaximized', true);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'close':
|
case 'close':
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
let isMaximized = false;
|
let isMaximized = false;
|
||||||
|
|
||||||
if (electron) {
|
if (electron) {
|
||||||
apiOn('maximize', (maximized: boolean) => {
|
apiOn('setIsMaximized', (maximized: boolean) => {
|
||||||
isMaximized = maximized;
|
isMaximized = maximized;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user