mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-21 00:01:22 +02:00
Better titlebar control icons
This commit is contained in:
@@ -109,7 +109,7 @@ export function SettingsDropdown() {
|
|||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
<IconButton size="sm" title="Request Options" icon="gear" className="pointer-events-auto" />
|
<IconButton size="sm" title="Main Menu" icon="hamburger" className="pointer-events-auto" />
|
||||||
</Dropdown>
|
</Dropdown>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -177,8 +177,8 @@ function HeaderSize({ className, ...props }: HeaderSizeProps) {
|
|||||||
<div
|
<div
|
||||||
className={classNames(
|
className={classNames(
|
||||||
className,
|
className,
|
||||||
'h-md pt-[1px] flex items-center w-full pr-3 border-b',
|
'h-md pt-[1px] flex items-center w-full border-b',
|
||||||
platform?.osType === 'Darwin' ? 'pl-20' : 'pl-1'
|
platform?.osType === 'Darwin' ? 'pl-20 pr-3' : 'pl-1',
|
||||||
)}
|
)}
|
||||||
{...props}
|
{...props}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import React, { memo } from 'react';
|
import React, { memo, useState } from 'react';
|
||||||
import { Icon } from './core/Icon';
|
import { Icon } from './core/Icon';
|
||||||
import { HStack } from './core/Stacks';
|
import { HStack } from './core/Stacks';
|
||||||
import { EnvironmentActionsDropdown } from './EnvironmentActionsDropdown';
|
import { EnvironmentActionsDropdown } from './EnvironmentActionsDropdown';
|
||||||
@@ -17,6 +17,7 @@ interface Props {
|
|||||||
|
|
||||||
export const WorkspaceHeader = memo(function WorkspaceHeader({ className }: Props) {
|
export const WorkspaceHeader = memo(function WorkspaceHeader({ className }: Props) {
|
||||||
const osInfo = useOsInfo();
|
const osInfo = useOsInfo();
|
||||||
|
const [maximized, setMaximized] = useState<boolean>(false);
|
||||||
return (
|
return (
|
||||||
<HStack
|
<HStack
|
||||||
space={2}
|
space={2}
|
||||||
@@ -39,15 +40,45 @@ export const WorkspaceHeader = memo(function WorkspaceHeader({ className }: Prop
|
|||||||
<SettingsDropdown />
|
<SettingsDropdown />
|
||||||
</div>
|
</div>
|
||||||
{osInfo?.osType !== 'Darwin' && (
|
{osInfo?.osType !== 'Darwin' && (
|
||||||
<HStack className="ml-3" space={1} alignItems="center">
|
<HStack className="ml-4" space={1} alignItems="center">
|
||||||
<Button size="sm" onClick={() => appWindow.minimize()}>
|
<Button className="!text-gray-600 rounded-none" onClick={() => appWindow.minimize()}>
|
||||||
-
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
|
||||||
|
<path fill="currentColor" d="M14 8v1H3V8z" />
|
||||||
|
</svg>
|
||||||
</Button>
|
</Button>
|
||||||
<Button size="sm" onClick={() => appWindow.toggleMaximize()}>
|
<Button
|
||||||
o
|
className="!text-gray-600 rounded-none"
|
||||||
|
onClick={async () => {
|
||||||
|
await appWindow.toggleMaximize();
|
||||||
|
setMaximized(await appWindow.isMaximized());
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{maximized ? (
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
|
||||||
|
<path fill="currentColor" d="M3 3v10h10V3zm9 9H4V4h8z" />
|
||||||
|
</svg>
|
||||||
|
) : (
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
|
||||||
|
<g fill="currentColor">
|
||||||
|
<path d="M3 5v9h9V5zm8 8H4V6h7z" />
|
||||||
|
<path fillRule="evenodd" d="M5 5h1V4h7v7h-1v1h2V3H5z" clipRule="evenodd" />
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
)}
|
||||||
</Button>
|
</Button>
|
||||||
<Button size="sm" onClick={() => appWindow.close()}>
|
<Button
|
||||||
x
|
color="custom"
|
||||||
|
className="text-gray-600 rounded-none hocus:bg-red-200 hocus:text-gray-800"
|
||||||
|
onClick={() => appWindow.close()}
|
||||||
|
>
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
|
||||||
|
<path
|
||||||
|
fill="currentColor"
|
||||||
|
fillRule="evenodd"
|
||||||
|
d="m7.116 8l-4.558 4.558l.884.884L8 8.884l4.558 4.558l.884-.884L8.884 8l4.558-4.558l-.884-.884L8 7.116L3.442 2.558l-.884.884z"
|
||||||
|
clipRule="evenodd"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
</Button>
|
</Button>
|
||||||
</HStack>
|
</HStack>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -6,6 +6,9 @@ import { ReactComponent as LeftPanelHiddenIcon } from '../../assets/icons/LeftPa
|
|||||||
import { ReactComponent as LeftPanelVisibleIcon } from '../../assets/icons/LeftPanelVisibleIcon.svg';
|
import { ReactComponent as LeftPanelVisibleIcon } from '../../assets/icons/LeftPanelVisibleIcon.svg';
|
||||||
|
|
||||||
const icons = {
|
const icons = {
|
||||||
|
square: I.SquareIcon,
|
||||||
|
minus: I.MinusIcon,
|
||||||
|
hamburger: I.HamburgerMenuIcon,
|
||||||
archive: I.ArchiveIcon,
|
archive: I.ArchiveIcon,
|
||||||
chat: I.ChatBubbleIcon,
|
chat: I.ChatBubbleIcon,
|
||||||
check: I.CheckIcon,
|
check: I.CheckIcon,
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
#root {
|
#root {
|
||||||
@apply bg-gray-50 text-gray-900 overflow-hidden rounded-lg;
|
@apply bg-gray-50 text-gray-900 overflow-hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Setup default transitions for elements */
|
/* Setup default transitions for elements */
|
||||||
|
|||||||
Reference in New Issue
Block a user