mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-19 23:31:21 +02:00
Ignore stoplights when centering settings title
This commit is contained in:
@@ -6,12 +6,19 @@ import { useOsInfo } from '../hooks/useOsInfo';
|
|||||||
interface HeaderSizeProps extends HTMLAttributes<HTMLDivElement> {
|
interface HeaderSizeProps extends HTMLAttributes<HTMLDivElement> {
|
||||||
children?: ReactNode;
|
children?: ReactNode;
|
||||||
size: 'md' | 'lg';
|
size: 'md' | 'lg';
|
||||||
|
ignoreStoplights?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function HeaderSize({ className, style, size, ...props }: HeaderSizeProps) {
|
export function HeaderSize({
|
||||||
|
className,
|
||||||
|
style,
|
||||||
|
size,
|
||||||
|
ignoreStoplights,
|
||||||
|
...props
|
||||||
|
}: HeaderSizeProps) {
|
||||||
const platform = useOsInfo();
|
const platform = useOsInfo();
|
||||||
const fullscreen = useIsFullscreen();
|
const fullscreen = useIsFullscreen();
|
||||||
const stoplightsVisible = platform?.osType === 'macos' && !fullscreen;
|
const stoplightsVisible = platform?.osType === 'macos' && !fullscreen && !ignoreStoplights;
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
data-tauri-drag-region
|
data-tauri-drag-region
|
||||||
|
|||||||
@@ -28,13 +28,14 @@ export const Settings = () => {
|
|||||||
<>
|
<>
|
||||||
<HeaderSize
|
<HeaderSize
|
||||||
data-tauri-drag-region
|
data-tauri-drag-region
|
||||||
|
ignoreStoplights
|
||||||
size="md"
|
size="md"
|
||||||
className="x-theme-appHeader bg-background text-fg-subtle flex items-center justify-center border-b border-background-highlight text-sm font-semibold"
|
className="x-theme-appHeader bg-background text-fg-subtle flex items-center justify-center border-b border-background-highlight text-sm font-semibold"
|
||||||
>
|
>
|
||||||
<HStack
|
<HStack
|
||||||
space={2}
|
space={2}
|
||||||
justifyContent="center"
|
justifyContent="center"
|
||||||
className="w-full h-full grid grid-cols-[1fr_auto]"
|
className="w-full h-full grid grid-cols-[1fr_auto] pointer-events-none"
|
||||||
>
|
>
|
||||||
<div className="text-center">Settings</div>
|
<div className="text-center">Settings</div>
|
||||||
<WindowControls className="ml-auto" />
|
<WindowControls className="ml-auto" />
|
||||||
|
|||||||
Reference in New Issue
Block a user