fix styling on web titlebar style

This commit is contained in:
jeffvli 2025-06-24 20:14:15 -07:00
parent c84dd648ea
commit 8598313d12
4 changed files with 29 additions and 36 deletions

View file

@ -3,6 +3,7 @@
width: 130px;
height: 100%;
-webkit-app-region: no-drag;
background-color: var(--theme-colors-background);
}
.windows-button {
@ -25,5 +26,7 @@
}
.windows-button.exit-button {
background: var(--theme-colors-state-error);
&:hover {
background: var(--theme-colors-state-error);
}
}

View file

@ -7,10 +7,6 @@ import styles from './window-controls.module.css';
const browser = isElectron() ? window.api.browser : null;
interface WindowControlsProps {
style?: 'linux' | 'macos' | 'windows';
}
const close = () => browser?.exit();
const minimize = () => browser?.minimize();
@ -19,7 +15,7 @@ const maximize = () => browser?.maximize();
const unmaximize = () => browser?.unmaximize();
export const WindowControls = ({ style }: WindowControlsProps) => {
export const WindowControls = () => {
const [max, setMax] = useState(false);
const handleMinimize = () => minimize();
@ -39,29 +35,29 @@ export const WindowControls = ({ style }: WindowControlsProps) => {
<>
{isElectron() && (
<>
{style === 'windows' && (
<div className={styles.windowsButtonGroup}>
<div
onClick={handleMinimize}
role="button"
>
<RiSubtractLine size={19} />
</div>
<div
onClick={handleMaximize}
role="button"
>
<RiCheckboxBlankLine size={13} />
</div>
<div
className={clsx(styles.windowsButton, styles.exitButton)}
onClick={handleClose}
role="button"
>
<RiCloseLine size={19} />
</div>
<div className={styles.windowsButtonGroup}>
<div
className={styles.windowsButton}
onClick={handleMinimize}
role="button"
>
<RiSubtractLine size={19} />
</div>
)}
<div
className={styles.windowsButton}
onClick={handleMaximize}
role="button"
>
<RiCheckboxBlankLine size={13} />
</div>
<div
className={clsx(styles.windowsButton, styles.exitButton)}
onClick={handleClose}
role="button"
>
<RiCloseLine size={19} />
</div>
</div>
</>
)}
</>