Use native Windows title bar
All checks were successful
Build Windows App / build-windows (push) Successful in 22m0s
All checks were successful
Build Windows App / build-windows (push) Successful in 22m0s
This commit is contained in:
@@ -5,8 +5,6 @@ import { fileURLToPath } from "node:url";
|
||||
|
||||
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
||||
|
||||
let mainWindow: BrowserWindow | null = null;
|
||||
|
||||
async function createWindow() {
|
||||
const win = new BrowserWindow({
|
||||
width: 1220,
|
||||
@@ -14,7 +12,7 @@ async function createWindow() {
|
||||
minWidth: 980,
|
||||
minHeight: 680,
|
||||
title: "EnvHelper",
|
||||
frame: false,
|
||||
frame: true,
|
||||
autoHideMenuBar: true,
|
||||
backgroundColor: "#f6f7f4",
|
||||
webPreferences: {
|
||||
@@ -24,13 +22,6 @@ async function createWindow() {
|
||||
}
|
||||
});
|
||||
|
||||
mainWindow = win;
|
||||
win.on("closed", () => {
|
||||
if (mainWindow === win) {
|
||||
mainWindow = null;
|
||||
}
|
||||
});
|
||||
|
||||
Menu.setApplicationMenu(null);
|
||||
|
||||
if (!app.isPackaged) {
|
||||
@@ -57,27 +48,6 @@ ipcMain.handle("envhelper:open-file", async () => {
|
||||
};
|
||||
});
|
||||
|
||||
ipcMain.on("envhelper:window-minimize", () => {
|
||||
mainWindow?.minimize();
|
||||
});
|
||||
|
||||
ipcMain.on("envhelper:window-toggle-maximize", () => {
|
||||
if (!mainWindow) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (mainWindow.isMaximized()) {
|
||||
mainWindow.unmaximize();
|
||||
return;
|
||||
}
|
||||
|
||||
mainWindow.maximize();
|
||||
});
|
||||
|
||||
ipcMain.on("envhelper:window-close", () => {
|
||||
mainWindow?.close();
|
||||
});
|
||||
|
||||
ipcMain.handle("envhelper:save-file", async (_event, content: string) => {
|
||||
const result = await dialog.showSaveDialog({
|
||||
defaultPath: ".env",
|
||||
|
||||
Reference in New Issue
Block a user