diff options
| author | Brendan Allan <[email protected]> | 2026-02-02 15:54:25 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-02-02 07:54:25 +0000 |
| commit | c02dd067b2ae62553c63b087b7b48a0f46628747 (patch) | |
| tree | b152fe0f6e429f317486762b92d366a97f9706a4 /packages/app/src/components | |
| parent | 141fdef5886cc5e161fb9e857b61c5081519d2f6 (diff) | |
| download | opencode-c02dd067b2ae62553c63b087b7b48a0f46628747.tar.gz opencode-c02dd067b2ae62553c63b087b7b48a0f46628747.zip | |
fix(desktop): keep mac titlebar stable under zoom (#11747)
Diffstat (limited to 'packages/app/src/components')
| -rw-r--r-- | packages/app/src/components/titlebar.tsx | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/packages/app/src/components/titlebar.tsx b/packages/app/src/components/titlebar.tsx index 001f7a567..affb68541 100644 --- a/packages/app/src/components/titlebar.tsx +++ b/packages/app/src/components/titlebar.tsx @@ -24,6 +24,8 @@ export function Titlebar() { const mac = createMemo(() => platform.platform === "desktop" && platform.os === "macos") const windows = createMemo(() => platform.platform === "desktop" && platform.os === "windows") const web = createMemo(() => platform.platform === "web") + const zoom = () => platform.webviewZoom?.() ?? 1 + const minHeight = () => (mac() ? `${40 / zoom()}px` : undefined) const [history, setHistory] = createStore({ stack: [] as string[], @@ -134,6 +136,7 @@ export function Titlebar() { return ( <header class="h-10 shrink-0 bg-background-base relative grid grid-cols-[auto_minmax(0,1fr)_auto] items-center" + style={{ "min-height": minHeight() }} data-tauri-drag-region > <div @@ -145,7 +148,7 @@ export function Titlebar() { data-tauri-drag-region > <Show when={mac()}> - <div class="w-[72px] h-full shrink-0" data-tauri-drag-region /> + <div class="h-full shrink-0" style={{ width: `${72 / zoom()}px` }} data-tauri-drag-region /> <div class="xl:hidden w-10 shrink-0 flex items-center justify-center"> <IconButton icon="menu" |
