fix(titlebar): reserve Windows window controls for logo
This commit is contained in:
@@ -17,6 +17,9 @@ import type { SidebarPeekSource } from './sidebar-peek';
|
||||
|
||||
type SidebarPeekChange = (open: boolean, source: SidebarPeekSource) => void;
|
||||
|
||||
// Three 44px buttons plus the control container's 8px padding on each side.
|
||||
const WINDOWS_TITLEBAR_CONTROLS_WIDTH = 148;
|
||||
|
||||
type TitleBarProps = {
|
||||
integrated?: boolean;
|
||||
workspaceLayout?: boolean;
|
||||
@@ -47,6 +50,7 @@ function ProductTitleBar({
|
||||
overlay = false,
|
||||
pageTitle,
|
||||
children,
|
||||
windowControlsWidth = 0,
|
||||
nativeTrafficLights = false,
|
||||
sidebarPeekOpen = false,
|
||||
onSidebarPeekChange,
|
||||
@@ -56,6 +60,7 @@ function ProductTitleBar({
|
||||
overlay?: boolean;
|
||||
pageTitle?: string;
|
||||
children?: React.ReactNode;
|
||||
windowControlsWidth?: number;
|
||||
nativeTrafficLights?: boolean;
|
||||
sidebarPeekOpen?: boolean;
|
||||
onSidebarPeekChange?: SidebarPeekChange;
|
||||
@@ -119,7 +124,7 @@ function ProductTitleBar({
|
||||
overlay ? 'bg-transparent' : 'bg-background',
|
||||
)}
|
||||
style={{
|
||||
right: '0px',
|
||||
right: `${windowControlsWidth}px`,
|
||||
}}
|
||||
>
|
||||
<img
|
||||
@@ -218,6 +223,7 @@ function ProductTitleBar({
|
||||
'no-drag absolute inset-y-0 right-0 z-10 flex items-center justify-end gap-1 px-2',
|
||||
overlay && 'pointer-events-auto',
|
||||
)}
|
||||
style={windowControlsWidth ? { width: `${windowControlsWidth}px` } : undefined}
|
||||
>
|
||||
{children}
|
||||
</div>
|
||||
@@ -257,7 +263,15 @@ function WindowsTitleBar({ integrated, workspaceLayout, overlay, pageTitle, side
|
||||
};
|
||||
|
||||
return (
|
||||
<ProductTitleBar integrated={integrated} workspaceLayout={workspaceLayout} overlay={overlay} pageTitle={pageTitle} sidebarPeekOpen={sidebarPeekOpen} onSidebarPeekChange={onSidebarPeekChange}>
|
||||
<ProductTitleBar
|
||||
integrated={integrated}
|
||||
workspaceLayout={workspaceLayout}
|
||||
overlay={overlay}
|
||||
pageTitle={pageTitle}
|
||||
windowControlsWidth={WINDOWS_TITLEBAR_CONTROLS_WIDTH}
|
||||
sidebarPeekOpen={sidebarPeekOpen}
|
||||
onSidebarPeekChange={onSidebarPeekChange}
|
||||
>
|
||||
<div className="no-drag pointer-events-auto flex h-full">
|
||||
<button
|
||||
onClick={handleMinimize}
|
||||
|
||||
Reference in New Issue
Block a user