From d214a9d8d845c6ccb5164aa455c0123034be8304 Mon Sep 17 00:00:00 2001 From: Cateds Date: Mon, 14 Sep 2026 03:38:06 +0800 Subject: [PATCH] =?UTF-8?q?fix(macos):=20=E6=B7=BB=E5=8A=A0=E6=A0=87?= =?UTF-8?q?=E9=A2=98=E6=A0=8F=E6=8B=96=E6=8B=BD=E5=8C=BA=E5=9F=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/celemod-ui/src/components/WindowTitlebar.tsx | 8 ++++++++ src/celemod-ui/src/index.scss | 12 ++++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/celemod-ui/src/components/WindowTitlebar.tsx b/src/celemod-ui/src/components/WindowTitlebar.tsx index 1294e0e..dcb6721 100644 --- a/src/celemod-ui/src/components/WindowTitlebar.tsx +++ b/src/celemod-ui/src/components/WindowTitlebar.tsx @@ -47,6 +47,14 @@ export function WindowTitlebar() { }; }, [platform]); + if (platform === "macos") { + // macOS keeps the native traffic lights via `titleBarStyle: "Overlay"`. + // This empty strip fills the reserved title bar area and makes the whole + // band draggable (Tauri handles dragging and double-click zoom; the native + // traffic lights stay clickable above the webview). + return
; + } + if (platform !== "windows") return null; return ( diff --git a/src/celemod-ui/src/index.scss b/src/celemod-ui/src/index.scss index 9d59a94..2e7b83d 100644 --- a/src/celemod-ui/src/index.scss +++ b/src/celemod-ui/src/index.scss @@ -75,6 +75,14 @@ textarea, user-select: none; } +/* macOS uses a native overlay title bar: this strip must match the traffic + light area reserved by `trafficLightPosition` in tauri.macos.conf.json. + The component marks it with data-tauri-drag-region for window dragging. */ +.macos-titlebar { + flex: 0 0 32px; + min-height: 32px; +} + .window-caption { flex: 0 0 auto; padding: 0; @@ -162,10 +170,6 @@ textarea, min-height: 0; } -html[data-platform="macos"] .app-shell { - padding-top: 32px; -} - .sidebar { display: flex; flex-direction: column;