diff --git a/main.js b/main.js index 464bbb1..51a12c2 100644 --- a/main.js +++ b/main.js @@ -101,10 +101,15 @@ function createWindow(startUrl) { }; if (process.platform === 'darwin') { + // Use a hidden/transparent title bar on macOS so we can render a + // custom, sleeker header in the renderer while still supporting + // native traffic-light placement. The renderer will expose a + // draggable region via CSS (-webkit-app-region: drag). Object.assign(windowOptions, { frame: true, titleBarStyle: 'hidden', trafficLightPosition: { x: 15, y: 20 }, + // Transparent background so renderer chrome blends with content. backgroundColor: '#00000000', transparent: true, }); diff --git a/renderer/style.css b/renderer/style.css index dd6dc21..95a6299 100644 --- a/renderer/style.css +++ b/renderer/style.css @@ -40,6 +40,40 @@ html, body { box-shadow: none; } +/* Make the top nav a draggable region on macOS when we use a hidden titlebar. + Interactive controls inside must opt-out with -webkit-app-region: no-drag. */ +@supports (-webkit-app-region: drag) { + /* Make both the tab strip and the nav area draggable so users have a + larger region to click-and-drag the window. Keep interactive elements + marked as no-drag so buttons and tabs remain clickable. */ + #tab-bar, + #nav { + -webkit-app-region: drag; + user-select: none; + /* keep the appearance consistent even if transparent window behind it */ + background: rgba(30,30,46,0.9); + backdrop-filter: blur(6px); + } + + /* Interactive controls must explicitly opt-out of dragging. This keeps + the larger draggable area while preserving normal click behavior. */ + #nav button, + #nav input, + #menu-popup, + .tab, + .tab *, + .new-tab-button, + .tab .tab-close, + #window-controls { + -webkit-app-region: no-drag; + } + + /* Ensure the new-tab button (which sits on the tab strip) is not draggable */ + #tab-bar .new-tab-button { + -webkit-app-region: no-drag; + } +} + .nav-left, .nav-center, .nav-right {