mirror of
https://github.com/openswarm-ai/openswarm.git
synced 2026-08-17 18:25:42 +02:00
[eric] shell: native window background follows the theme, live-resize filler never flashes boot-dark under a light UI
This commit is contained in:
@@ -3125,6 +3125,13 @@ ipcMain.handle('set-window-buttons-visible', (_e, visible) => {
|
||||
if (process.platform !== 'darwin' || !mainWindow || mainWindow.isDestroyed()) return;
|
||||
try { mainWindow.setWindowButtonVisibility(!!visible); } catch (err) { console.warn('[main] setWindowButtonVisibility failed:', err.message); }
|
||||
});
|
||||
// The creation-time backgroundColor is boot-dark; the renderer re-points it at the live theme's page
|
||||
// color so a live resize paints theme-matched filler, not a dark band behind a light UI.
|
||||
ipcMain.handle('set-window-background', (_e, color) => {
|
||||
if (!mainWindow || mainWindow.isDestroyed()) return;
|
||||
if (typeof color !== 'string' || !/^#[0-9a-fA-F]{6}$/.test(color)) return;
|
||||
try { mainWindow.setBackgroundColor(color); } catch (err) { console.warn('[main] setBackgroundColor failed:', err.message); }
|
||||
});
|
||||
// Phase 2 provenance: the renderer's About panel shows the commit this build
|
||||
// was cut from, so a screenshot is enough to identify the exact code shipped.
|
||||
ipcMain.handle('get-build-info', () => getBuildInfo());
|
||||
|
||||
@@ -41,6 +41,8 @@ contextBridge.exposeInMainWorld('openswarm', {
|
||||
getAppVersion: () => ipcRenderer.invoke('get-app-version'),
|
||||
// Arc-style chrome: the mac traffic lights hide at rest; the dashboard's top-edge hover reveals them.
|
||||
setWindowButtonsVisible: (visible) => ipcRenderer.invoke('set-window-buttons-visible', visible),
|
||||
// Native window bg tracks the theme so a live resize never paints the boot-dark color behind a light UI.
|
||||
setWindowBackground: (color) => ipcRenderer.invoke('set-window-background', color),
|
||||
|
||||
// Phase 2 provenance: { sha, shortSha, builtAt, channel } for the About panel.
|
||||
getBuildInfo: () => ipcRenderer.invoke('get-build-info'),
|
||||
|
||||
Reference in New Issue
Block a user