diff --git a/src/bun/windows.ts b/src/bun/windows.ts index b28d355..6c2b5c0 100644 --- a/src/bun/windows.ts +++ b/src/bun/windows.ts @@ -51,7 +51,14 @@ export function buildPreload( * gtk_window_set_decorated(false). */ export function chromeOptions() { - return { titleBarStyle: "hidden" as const }; + // `transparent` is what lets the Aero frame be a real frame: .window's 6px + // radius and its outer drop shadow are drawn by the webview OUTSIDE the + // window's own rectangle, so on an opaque surface they are simply clipped — + // square corners and no shadow. The UI reserves the shadow's gutter (see + // the .window margin in styles.css). + // PORTABILITY: on Linux this needs a compositor granting an RGBA visual; + // without one the frame still draws, just without the shadow falloff. + return { titleBarStyle: "hidden" as const, transparent: true }; } /** diff --git a/ui/src/app/connection-manager/connection-manager.html b/ui/src/app/connection-manager/connection-manager.html index 5da4792..eee5f9f 100644 --- a/ui/src/app/connection-manager/connection-manager.html +++ b/ui/src/app/connection-manager/connection-manager.html @@ -1,5 +1,5 @@ -
- +
+ +
@if (!ctx) {
@@ -10,8 +10,8 @@
} @else { - + diff --git a/ui/src/app/editor-window/editor-window.ts b/ui/src/app/editor-window/editor-window.ts index a4e4163..4b98cfa 100644 --- a/ui/src/app/editor-window/editor-window.ts +++ b/ui/src/app/editor-window/editor-window.ts @@ -35,12 +35,19 @@ const DRAFT_DEBOUNCE_MS = 400; templateUrl: './editor-window.html', host: { '(window:keydown)': 'onKeydown($event)', - '(window:blur)': 'flushDraft()', '(window:contextmenu)': 'blockContextMenu($event)', + // Aero desaturates an unfocused window's chrome — see .window.active. + // blur already had to flush the draft; both run from the one binding + // (a duplicated key is a TS1117 build error, not a merge). + '(window:focus)': 'windowFocused.set(true)', + '(window:blur)': 'flushDraft(); windowFocused.set(false)', }, }) export class EditorWindow { readonly i18n = inject(I18nService); + + /** Drives `.window.active` on this window's Aero frame. */ + readonly windowFocused = signal(document.hasFocus()); readonly ctx = EDITOR_CONTEXT; readonly modLabel = MOD_LABEL; readonly altLabel = ALT_LABEL; diff --git a/ui/src/index.html b/ui/src/index.html index 4a2bbaf..bfb813c 100644 --- a/ui/src/index.html +++ b/ui/src/index.html @@ -6,24 +6,13 @@ - diff --git a/ui/src/styles.css b/ui/src/styles.css index 58a49c6..11f73ff 100644 --- a/ui/src/styles.css +++ b/ui/src/styles.css @@ -639,6 +639,17 @@ body { border-color: var(--w7-li-bd-hl); } + /* ---- Window frame ---- + The native window is transparent (chromeOptions in src/bun/windows.ts), so + nothing but .window paints an opaque surface. The margin is the gutter the + drop shadow falls into — without it the shadow has no room and the frame + reads as square. h-screen (100vh) has to shrink by the same amount or the + window overflows into a scrollbar. */ + .win7 .window { + margin: 6px; + height: calc(100vh - 12px); + } + /* Constant row geometry. 7.css gives ONLY tr.highlighted a 1px border, and the table is border-collapse: collapse — so a selected row physically grew 1px at top and bottom and shoved every row below it down by 2px as the