Basic Linux/Windows integrated titlebar

This commit is contained in:
Gregory Schier
2024-01-13 23:40:32 -08:00
parent 3086d815c1
commit 3a4a76c58d
11 changed files with 133 additions and 60 deletions

View File

@@ -178,7 +178,7 @@ function HeaderSize({ className, ...props }: HeaderSizeProps) {
className={classNames(
className,
'h-md pt-[1px] flex items-center w-full pr-3 border-b',
platform?.osType === 'Darwin' && 'pl-20',
platform?.osType === 'Darwin' ? 'pl-20' : 'pl-1'
)}
{...props}
/>

View File

@@ -7,12 +7,16 @@ import { RecentRequestsDropdown } from './RecentRequestsDropdown';
import { SettingsDropdown } from './SettingsDropdown';
import { SidebarActions } from './SidebarActions';
import { WorkspaceActionsDropdown } from './WorkspaceActionsDropdown';
import { useOsInfo } from '../hooks/useOsInfo';
import { Button } from './core/Button';
import { appWindow } from '@tauri-apps/api/window';
interface Props {
className?: string;
}
export const WorkspaceHeader = memo(function WorkspaceHeader({ className }: Props) {
const osInfo = useOsInfo();
return (
<HStack
space={2}
@@ -34,6 +38,19 @@ export const WorkspaceHeader = memo(function WorkspaceHeader({ className }: Prop
<div className="flex-1 flex justify-end -mr-2 pointer-events-none">
<SettingsDropdown />
</div>
{osInfo?.osType !== 'Darwin' && (
<HStack className="ml-3" space={1} alignItems="center">
<Button size="sm" onClick={() => appWindow.minimize()}>
-
</Button>
<Button size="sm" onClick={() => appWindow.toggleMaximize()}>
o
</Button>
<Button size="sm" onClick={() => appWindow.close()}>
x
</Button>
</HStack>
)}
</HStack>
);
});