feat: add a macOS menu bar toggle for desktop

Adds a General settings switch to show or hide the macOS menu bar item.
Persists the new desktopMacMenuBarEnabled setting and passes tray state into Electron.
Disables tray sync and native tray setup when the menu bar is turned off.
This commit is contained in:
Bohdan Triapitsyn
2026-07-22 10:08:58 +03:00
parent 1c82198289
commit 1c7cdf68e3
21 changed files with 116 additions and 15 deletions
+2
View File
@@ -22,6 +22,7 @@ const macVibrancySupported = process.platform === 'darwin';
// Effective state for this window (main process resolves the saved preference
// and passes it in). Defaults on when supported unless explicitly '0'.
const hasMacVibrancy = macVibrancySupported && readArgValue('--openchamber-mac-vibrancy') !== '0';
const trayEnabled = process.platform !== 'darwin' || readArgValue('--openchamber-tray-enabled') !== '0';
// Preload re-executes on every cross-origin navigation (we run with
// sandbox:false, per-document). Two separate concerns to balance:
@@ -97,6 +98,7 @@ contextBridge.exposeInMainWorld('__OPENCHAMBER_ELECTRON__', {
runtime: 'electron',
macVibrancy: hasMacVibrancy,
macVibrancySupported,
trayEnabled,
});
contextBridge.exposeInMainWorld('__OPENCHAMBER_PLATFORM__', process.platform);