mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-04-15 07:42:28 +08:00
fix(common): improve window dragging area in FullScreenPanel (#525)
Add data-tauri-drag-region and WebkitAppRegion styles to header area to match App.tsx behavior, ensuring proper window dragging on macOS.
This commit is contained in:
@@ -50,31 +50,44 @@ export const FullScreenPanel: React.FC<FullScreenPanelProps> = ({
|
||||
{/* Drag region - match App.tsx */}
|
||||
<div
|
||||
data-tauri-drag-region
|
||||
style={{
|
||||
WebkitAppRegion: "drag",
|
||||
height: DRAG_BAR_HEIGHT,
|
||||
} as React.CSSProperties}
|
||||
style={
|
||||
{
|
||||
WebkitAppRegion: "drag",
|
||||
height: DRAG_BAR_HEIGHT,
|
||||
} as React.CSSProperties
|
||||
}
|
||||
/>
|
||||
|
||||
{/* Header - match App.tsx */}
|
||||
<div
|
||||
className="flex-shrink-0 flex items-center"
|
||||
style={{
|
||||
backgroundColor: "hsl(var(--background))",
|
||||
height: HEADER_HEIGHT,
|
||||
}}
|
||||
data-tauri-drag-region
|
||||
style={
|
||||
{
|
||||
WebkitAppRegion: "drag",
|
||||
backgroundColor: "hsl(var(--background))",
|
||||
height: HEADER_HEIGHT,
|
||||
} as React.CSSProperties
|
||||
}
|
||||
>
|
||||
<div className="mx-auto max-w-[56rem] px-6 w-full flex items-center gap-4">
|
||||
<div
|
||||
className="mx-auto max-w-[56rem] px-6 w-full flex items-center gap-4"
|
||||
data-tauri-drag-region
|
||||
style={{ WebkitAppRegion: "drag" } as React.CSSProperties}
|
||||
>
|
||||
<Button
|
||||
type="button"
|
||||
variant="outline"
|
||||
size="icon"
|
||||
onClick={onClose}
|
||||
className="rounded-lg"
|
||||
className="rounded-lg select-none"
|
||||
style={{ WebkitAppRegion: "no-drag" } as React.CSSProperties}
|
||||
>
|
||||
<ArrowLeft className="h-4 w-4" />
|
||||
</Button>
|
||||
<h2 className="text-lg font-semibold text-foreground">{title}</h2>
|
||||
<h2 className="text-lg font-semibold text-foreground select-none">
|
||||
{title}
|
||||
</h2>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user