summaryrefslogtreecommitdiffhomepage
path: root/packages/app/src
diff options
context:
space:
mode:
authorBrendan Allan <[email protected]>2026-01-21 22:35:05 +0800
committerGitHub <[email protected]>2026-01-21 08:35:05 -0600
commitd00b8df7707c0a4ad94ce7a3488780fe5764ae6c (patch)
treef11e31b8cf95271711a4297ea09b54f6ce34dc1a /packages/app/src
parent7ed448a7e8d8e1d2278086fe6dd2bd5b5e18e4f3 (diff)
downloadopencode-d00b8df7707c0a4ad94ce7a3488780fe5764ae6c.tar.gz
opencode-d00b8df7707c0a4ad94ce7a3488780fe5764ae6c.zip
feat(desktop): properly integrate window controls on windows (#9835)
Diffstat (limited to 'packages/app/src')
-rw-r--r--packages/app/src/components/titlebar.tsx18
1 files changed, 14 insertions, 4 deletions
diff --git a/packages/app/src/components/titlebar.tsx b/packages/app/src/components/titlebar.tsx
index d0d27e99f..7e50687d5 100644
--- a/packages/app/src/components/titlebar.tsx
+++ b/packages/app/src/components/titlebar.tsx
@@ -18,6 +18,7 @@ export function Titlebar() {
const theme = useTheme()
const mac = createMemo(() => platform.platform === "desktop" && platform.os === "macos")
+ const windows = createMemo(() => platform.platform === "desktop" && platform.os === "windows")
const reserve = createMemo(
() => platform.platform === "desktop" && (platform.os === "windows" || platform.os === "linux"),
)
@@ -75,13 +76,15 @@ export function Titlebar() {
}
return (
- <header class="h-10 shrink-0 bg-background-base flex items-center relative">
+ <header class="h-10 shrink-0 bg-background-base flex items-center relative" data-tauri-drag-region>
<div
classList={{
- "flex items-center w-full min-w-0 pr-2": true,
+ "flex items-center w-full min-w-0": true,
"pl-2": !mac(),
+ "pr-2": !windows(),
}}
onMouseDown={drag}
+ data-tauri-drag-region
>
<Show when={mac()}>
<div class="w-[72px] h-full shrink-0" data-tauri-drag-region />
@@ -116,9 +119,16 @@ export function Titlebar() {
</div>
</Button>
</TooltipKeybind>
- <div id="opencode-titlebar-left" class="flex items-center gap-3 min-w-0 px-2" />
+ <div id="opencode-titlebar-left" class="flex items-center gap-3 min-w-0 px-2" data-tauri-drag-region />
<div class="flex-1 h-full" data-tauri-drag-region />
- <div id="opencode-titlebar-right" class="flex items-center gap-3 shrink-0 flex-1 justify-end" />
+ <div
+ id="opencode-titlebar-right"
+ class="flex items-center gap-3 shrink-0 flex-1 justify-end"
+ data-tauri-drag-region
+ />
+ <Show when={windows()}>
+ <div data-tauri-decorum-tb class="flex flex-row" />
+ </Show>
</div>
<div class="absolute inset-0 flex items-center justify-center pointer-events-none">
<div id="opencode-titlebar-center" class="pointer-events-auto" />