sanctum/src/native/about.ts
2026-04-05 20:16:25 -07:00

44 lines
957 B
TypeScript

import { join } from "node:path";
import { BrowserWindow } from "electron";
import { mainWindow } from "./window";
// global reference to about window
export let aboutWindow: BrowserWindow;
// Create our about window
export function createAboutWindow() {
aboutWindow = new BrowserWindow({
minWidth: 300,
minHeight: 300,
width: 1280,
height: 720,
center: true,
backgroundColor: "#191919",
frame: true,
resizable: false,
parent: mainWindow,
paintWhenInitiallyHidden: true,
webPreferences: {
preload: join(__dirname, "preload.js"),
contextIsolation: true,
nodeIntegration: false,
spellcheck: false,
devTools: false,
},
});
aboutWindow.setMenu(null);
aboutWindow.loadFile(join(__dirname, "about.html"));
aboutWindow.on("ready-to-show", () => {
aboutWindow.show();
});
aboutWindow.on("close", (e) => {
e.preventDefault();
aboutWindow.hide();
});
}