Skip to content

Commit 858cd5c

Browse files
fazxesclaude
andcommitted
feat(ui): enable window dragging from header bar
- Add core:window:allow-start-dragging permission - Set data-tauri-drag-region on header bar - Exclude interactive buttons from drag region - Configure macOS overlay title bar style 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent cdae0a8 commit 858cd5c

3 files changed

Lines changed: 12 additions & 4 deletions

File tree

‎src-tauri/capabilities/default.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"core:window:allow-maximize",
1010
"core:window:allow-set-size",
1111
"core:window:allow-set-title",
12+
"core:window:allow-start-dragging",
1213
"core:event:allow-listen",
1314
"core:event:allow-emit",
1415
"dialog:allow-open",

‎src-tauri/tauri.conf.json‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@
2222
"fullscreen": false,
2323
"decorations": true,
2424
"transparent": false,
25-
"center": true
25+
"center": true,
26+
"titleBarStyle": "overlay",
27+
"hiddenTitle": true
2628
}
2729
],
2830
"security": {

‎src/components/layout/header-bar.tsx‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ const TabButton: FC<TabButtonProps> = ({ label, active, onClick }) => {
2525
role="tab"
2626
aria-selected={active}
2727
tabIndex={active ? 0 : -1}
28+
data-tauri-drag-region={false}
2829
className={cn(
2930
'relative flex items-center justify-center transition-colors h-7 px-3',
3031
active ? 'text-foreground' : 'text-muted-foreground hover:text-foreground'
@@ -61,14 +62,17 @@ export const HeaderBar: FC<HeaderBarProps> = ({ className }) => {
6162

6263
return (
6364
<header
65+
data-tauri-drag-region
6466
className={cn(
65-
'h-[35px] flex items-center justify-between px-4 border-b border-border shrink-0',
67+
'h-[35px] flex items-center justify-between pr-4 border-b border-border shrink-0',
6668
'bg-sidebar',
69+
// Left padding for macOS traffic light buttons (about 78px)
70+
'pl-[78px]',
6771
className
6872
)}
6973
>
70-
{/* Left spacer for balance */}
71-
<div className="w-[200px]" />
74+
{/* Left spacer for balance (reduced since we have traffic light padding) */}
75+
<div className="w-[122px]" />
7276

7377
{/* Center tabs */}
7478
<div className="flex items-center gap-0.5" role="tablist" aria-orientation="horizontal">
@@ -98,6 +102,7 @@ export const HeaderBar: FC<HeaderBarProps> = ({ className }) => {
98102
{/* Right search button */}
99103
<div className="w-[200px] flex justify-end">
100104
<button
105+
data-tauri-drag-region={false}
101106
className="flex items-center h-6 rounded-md text-muted-foreground hover:text-foreground transition-colors overflow-hidden border border-border dark:border-border/50 bg-muted/50 hover:bg-muted"
102107
title="Search files (⌘P)"
103108
onClick={handleOpenSearch}

0 commit comments

Comments
 (0)