Sync titlebar overlay with theme
All checks were successful
Build Windows App / build-windows (push) Successful in 25m10s

This commit is contained in:
MrSphay
2026-05-01 18:14:29 +02:00
parent 7f5ed594b7
commit c76489a1e4
4 changed files with 40 additions and 3 deletions

View File

@@ -5,6 +5,17 @@ import { fileURLToPath } from "node:url";
const __dirname = path.dirname(fileURLToPath(import.meta.url));
const titleBarThemes = {
light: {
color: "#eef1ed",
symbolColor: "#17241d"
},
dark: {
color: "#132019",
symbolColor: "#e9f3ec"
}
};
async function createWindow() {
const win = new BrowserWindow({
width: 1220,
@@ -14,8 +25,7 @@ async function createWindow() {
title: "EnvHelper",
titleBarStyle: "hidden",
titleBarOverlay: {
color: "#eef1ed",
symbolColor: "#17241d",
...titleBarThemes.light,
height: 34
},
autoHideMenuBar: true,
@@ -53,6 +63,13 @@ ipcMain.handle("envhelper:open-file", async () => {
};
});
ipcMain.handle("envhelper:set-titlebar-theme", (event, theme: "light" | "dark") => {
BrowserWindow.fromWebContents(event.sender)?.setTitleBarOverlay({
...titleBarThemes[theme],
height: 34
});
});
ipcMain.handle("envhelper:save-file", async (_event, content: string) => {
const result = await dialog.showSaveDialog({
defaultPath: ".env",