1
0
mirror of https://github.com/upscayl/upscayl.git synced 2024-09-24 03:18:28 +02:00
upscayl/electron/main-window.ts
2023-09-11 08:37:07 +05:30

44 lines
1.0 KiB
TypeScript

import { BrowserWindow, shell } from "electron";
import { getPlatform } from "./get-device-specs";
import { join } from "path";
import {
setCustomModelsFolderPath,
setFolderPath,
setImagePath,
setOutputFolderPath,
setOverwrite,
setQuality,
setSaveOutputFolder,
} from "./utils/config-variables";
import COMMAND from "./constants/commands";
import electronIsDev from "electron-is-dev";
let mainWindow: BrowserWindow | null;
const createMainWindow = () => {
mainWindow = new BrowserWindow({
icon: join(__dirname, "build", "icon.png"),
width: 1300,
height: 940,
minHeight: 500,
minWidth: 500,
show: false,
backgroundColor: "#171717",
webPreferences: {
nodeIntegration: true,
nodeIntegrationInWorker: true,
webSecurity: false,
preload: join(__dirname, "preload.js"),
},
titleBarStyle: getPlatform() === "mac" ? "hiddenInset" : "default",
});
mainWindow.setMenuBarVisibility(false);
};
const getMainWindow = () => {
return mainWindow;
};
export { createMainWindow, getMainWindow };