From 1537c495bd860a1e9c56e3f5f33a4b36500972a2 Mon Sep 17 00:00:00 2001 From: Andrew Date: Tue, 9 Sep 2025 14:28:17 +1200 Subject: [PATCH] made window dragable --- .gitignore | 2 -- main.js | 2 +- renderer/index.html | 1 + renderer/style.css | 16 ++++------------ 4 files changed, 6 insertions(+), 15 deletions(-) diff --git a/.gitignore b/.gitignore index 19ff0e4..daeb04e 100644 --- a/.gitignore +++ b/.gitignore @@ -86,5 +86,3 @@ typings/ site-history.json bookmarks.json bookmarks.backup.json -bookmarks.json -bookmarks.backup.json diff --git a/main.js b/main.js index d8e6567..e7eef3f 100644 --- a/main.js +++ b/main.js @@ -120,7 +120,7 @@ function createWindow(startUrl) { // draggable region via CSS (-webkit-app-region: drag). Object.assign(windowOptions, { frame: true, - titleBarStyle: 'hidden', + titleBarStyle: 'hiddenInset', trafficLightPosition: { x: 15, y: 20 }, // Transparent background so renderer chrome blends with content. backgroundColor: '#00000000', diff --git a/renderer/index.html b/renderer/index.html index a2ddfbd..7af7e81 100644 --- a/renderer/index.html +++ b/renderer/index.html @@ -73,6 +73,7 @@ + diff --git a/renderer/style.css b/renderer/style.css index 3af6238..c950995 100644 --- a/renderer/style.css +++ b/renderer/style.css @@ -56,7 +56,8 @@ html, body { scrollbar-width: thin; /* slimmer track */ -webkit-backdrop-filter: blur(var(--blur)); backdrop-filter: blur(var(--blur)); - -webkit-app-region: no-drag; /* ensure HTML5 DnD works inside tab strip */ + /* Only the background areas are draggable. Individual tabs opt-out via no-drag. */ + -webkit-app-region: drag; } /* NAVBAR LAYOUT */ @@ -80,17 +81,8 @@ html, body { /* 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. */ - /* Keep only the nav area as a window-drag region so tabs can use HTML5 DnD */ - #nav { - -webkit-app-region: drag; - user-select: none; - /* keep the appearance consistent even if transparent window behind it */ - background: rgba(20,22,30,0.72); - backdrop-filter: blur(var(--blur)); - } + /* Make the top nav a draggable region, but only in its background/gaps. */ + #nav { -webkit-app-region: drag; user-select: none; } /* Interactive controls must explicitly opt-out of dragging. This keeps the larger draggable area while preserving normal click behavior. */