mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-21 00:49:45 +01:00
Basic Linux/Windows integrated titlebar
This commit is contained in:
@@ -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}
|
||||
/>
|
||||
|
||||
@@ -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>
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user