mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-02-14 20:22:10 +00:00
Merge pull request #504 from Kadu-H/main
Fix main window maximizing from splash
This commit is contained in:
commit
21305d3e39
1 changed files with 8 additions and 0 deletions
|
@ -19,6 +19,7 @@ export class WindowManager {
|
|||
public static mainWindow: Electron.BrowserWindow | null = null;
|
||||
public static splashWindow: Electron.BrowserWindow | null = null;
|
||||
public static isReadyToShowMainWindow = false;
|
||||
private static isMainMaximized = false;
|
||||
|
||||
private static loadURL(hash = "") {
|
||||
// HMR for renderer base on electron-vite cli.
|
||||
|
@ -71,6 +72,10 @@ export class WindowManager {
|
|||
|
||||
this.loadSplashURL();
|
||||
this.splashWindow.removeMenu();
|
||||
if (this.splashWindow?.isMaximized()) {
|
||||
this.splashWindow?.unmaximize();
|
||||
this.isMainMaximized = true;
|
||||
}
|
||||
}
|
||||
|
||||
public static createMainWindow() {
|
||||
|
@ -94,13 +99,16 @@ export class WindowManager {
|
|||
preload: path.join(__dirname, "../preload/index.mjs"),
|
||||
sandbox: false,
|
||||
},
|
||||
show: false,
|
||||
});
|
||||
|
||||
this.loadURL();
|
||||
this.mainWindow.removeMenu();
|
||||
if (this.isMainMaximized) this.mainWindow?.maximize();
|
||||
|
||||
this.mainWindow.on("ready-to-show", () => {
|
||||
if (!app.isPackaged) WindowManager.mainWindow?.webContents.openDevTools();
|
||||
WindowManager.mainWindow?.show();
|
||||
});
|
||||
|
||||
this.mainWindow.on("close", async () => {
|
||||
|
|
Loading…
Reference in a new issue