import { splitProps, mergeProps, type Component, type JSX } from 'solid-js'; import clsx from 'clsx'; import { getCurrentWindow } from '@tauri-apps/api/window'; import { GlowPerimeter, CHROME_CLIP_PATH } from './GlowPerimeter'; import { DotGrid } from './DotGrid'; import { Titlebar } from '../Titlebar'; const appWindow = getCurrentWindow(); const ISLAND_CLIP = 'polygon(6px 0, calc(100% - 6px) 0, 100% 6px, 100% calc(100% - 6px), calc(100% - 6px) 100%, 6px 100%, 0 calc(100% - 6px), 0 6px)'; const ISLAND_INNER_CLIP = 'polygon(5px 0, calc(100% - 5px) 0, 100% 5px, 100% calc(100% - 5px), calc(100% - 5px) 100%, 5px 100%, 0 calc(100% - 5px), 0 5px)'; interface WindowChromeProps { dotGrid?: boolean; children: JSX.Element; class?: string; } export const WindowChrome: Component = (rawProps) => { const props = mergeProps({ dotGrid: true }, rawProps); const [local] = splitProps(props, ['dotGrid', 'children', 'class']); return (
{/* Clipped chrome container */}
{/* Glow perimeter — z-index 10, above all content */} {/* Dot grid — z-index 0, behind content */} {/* Titlebar — fixed in chrome, above scroll area */} {/* Drag region overlay — above content (z:5), below glow (z:10) */}
{/* Scrollable content area — full height, content scrolls under titlebar */}
{local.children}
{/* Floating controls island — two-div border technique for angular borders */}
{/* Border layer */}
{/* Fill layer */}
); };