Hide windows controls behind the flags

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
Alex Andreev committed 2021-12-07 16:14:34 +03:00
1 parent 9a263b82e2
commit a05c7a7124
2 files changed
+31 -13

No files matched your search

+12
View File
@@ -32,6 +32,13 @@ import logger from "./logger";
import { isWindows, productName } from "../common/vars";
import { LensProxy } from "./lens-proxy";
export const enum IpcMainWindowEvents {
MINIMIZE = "window:minimize",
MAXIMIZE = "window:maximize",
CLOSE = "window:close",
OPEN_CONTEXT_MENU = "window:open-context-menu",
}
function isHideable(window: BrowserWindow | null): boolean {
return Boolean(window && !window.isDestroyed());
}
@@ -168,6 +175,11 @@ export class WindowManager extends Singleton {
ipcMainOn(IpcRendererNavigationEvents.CLUSTER_VIEW_CURRENT_ID, (event, clusterId: ClusterId) => {
this.activeClusterId = clusterId;
});
// custom window events, needed on windows and linux
ipcMainOn(IpcMainWindowEvents.MINIMIZE, () => this.mainWindow.minimize());
ipcMainOn(IpcMainWindowEvents.MAXIMIZE, () => this.mainWindow.maximize());
ipcMainOn(IpcMainWindowEvents.CLOSE, () => this.mainWindow.close());
}
async ensureMainWindow(showSplash = true): Promise<BrowserWindow> {