mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-07-02 02:51:40 +02:00
Tweaked header size logic
This commit is contained in:
@@ -36,9 +36,9 @@ export function HeaderSize({
|
|||||||
paddingLeft: stoplightsVisible ? 72 / settings.interfaceScale : undefined,
|
paddingLeft: stoplightsVisible ? 72 / settings.interfaceScale : undefined,
|
||||||
...(size === 'md' ? { height: HEADER_SIZE_MD } : {}),
|
...(size === 'md' ? { height: HEADER_SIZE_MD } : {}),
|
||||||
...(size === 'lg' ? { height: HEADER_SIZE_LG } : {}),
|
...(size === 'lg' ? { height: HEADER_SIZE_LG } : {}),
|
||||||
...(stoplightsVisible || ignoreControlsSpacing
|
...(osInfo.osType === 'macos' || ignoreControlsSpacing
|
||||||
? { paddingRight: '2px' }
|
? { paddingRight: '2px' }
|
||||||
: { paddingLeft: '2px', paddingRight: osInfo.osType !== 'macos' ? WINDOW_CONTROLS_WIDTH : '2px' }),
|
: { paddingLeft: '2px', paddingRight: WINDOW_CONTROLS_WIDTH }),
|
||||||
}}
|
}}
|
||||||
className={classNames(
|
className={classNames(
|
||||||
className,
|
className,
|
||||||
@@ -50,7 +50,7 @@ export function HeaderSize({
|
|||||||
<div className="pointer-events-none h-full w-full overflow-x-auto hide-scrollbars grid">
|
<div className="pointer-events-none h-full w-full overflow-x-auto hide-scrollbars grid">
|
||||||
{children}
|
{children}
|
||||||
</div>
|
</div>
|
||||||
<WindowControls onlyX={onlyXWindowControl} macos={osInfo.osType === 'macos'} />
|
<WindowControls onlyX={onlyXWindowControl} />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { getCurrentWebviewWindow } from '@tauri-apps/api/webviewWindow';
|
import { getCurrentWebviewWindow } from '@tauri-apps/api/webviewWindow';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import { useStoplightsVisible } from '../hooks/useStoplightsVisible';
|
import { useOsInfo } from '../hooks/useOsInfo';
|
||||||
import { Button } from './core/Button';
|
import { Button } from './core/Button';
|
||||||
import { HStack } from './core/Stacks';
|
import { HStack } from './core/Stacks';
|
||||||
|
|
||||||
@@ -13,14 +13,16 @@ interface Props {
|
|||||||
|
|
||||||
export const WINDOW_CONTROLS_WIDTH = '10.5rem';
|
export const WINDOW_CONTROLS_WIDTH = '10.5rem';
|
||||||
|
|
||||||
export function WindowControls({ className, onlyX, macos }: Props) {
|
export function WindowControls({ className, onlyX }: Props) {
|
||||||
const [maximized, setMaximized] = useState<boolean>(false);
|
const [maximized, setMaximized] = useState<boolean>(false);
|
||||||
const stoplightsVisible = useStoplightsVisible();
|
const osInfo = useOsInfo();
|
||||||
if (stoplightsVisible) {
|
|
||||||
|
// Never show controls on macOS
|
||||||
|
if (osInfo.osType === 'macos') {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return !macos && (
|
return (
|
||||||
<HStack
|
<HStack
|
||||||
className={classNames(className, 'ml-4 absolute right-0 top-0 bottom-0')}
|
className={classNames(className, 'ml-4 absolute right-0 top-0 bottom-0')}
|
||||||
justifyContent="end"
|
justifyContent="end"
|
||||||
|
|||||||
Reference in New Issue
Block a user