fix: sync title bar overlay colors with app theme

The Windows title bar overlay (minimize/maximize/close buttons) was
hardcoded to dark colors and did not update when switching themes.

- Add titleBarTheme helper that maps AppearanceTheme to overlay and
  background colors, using nativeTheme for the system preference
- Call applyTitleBarTheme from the setTheme IPC handler so the overlay
  updates immediately on theme change
- Apply persisted theme on startup so the overlay matches from launch

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
David Kaya
2026-03-24 19:31:49 +01:00
co-authored by Copilot
parent 973e5eb25c
commit 75934a161a
3 changed files with 49 additions and 3 deletions
+5
View File
@@ -3,6 +3,7 @@ import { app, BrowserWindow } from 'electron';
import { registerIpcHandlers } from '@main/ipc/registerIpcHandlers';
import { EryxAppService } from '@main/EryxAppService';
import { createMainWindow } from '@main/windows/createMainWindow';
import { applyTitleBarTheme } from '@main/windows/titleBarTheme';
let mainWindow: BrowserWindow | undefined;
let appService: EryxAppService | undefined;
@@ -13,6 +14,10 @@ async function bootstrap(): Promise<void> {
mainWindow = createMainWindow();
registerIpcHandlers(mainWindow, appService);
// Apply persisted theme to the title bar overlay
const workspace = await appService.loadWorkspace();
applyTitleBarTheme(mainWindow, workspace.settings.theme);
if (!app.isPackaged) {
mainWindow.webContents.openDevTools({ mode: 'detach' });
}