Maximize window on header double-click

This commit is contained in:
Gregory Schier
2024-09-19 06:03:46 -07:00
parent 6247603cec
commit 7e056aa93a

View File

@@ -1,3 +1,4 @@
import { getCurrentWebviewWindow } from '@tauri-apps/api/webviewWindow';
import classNames from 'classnames';
import type { HTMLAttributes, ReactNode } from 'react';
import { useIsFullscreen } from '../hooks/useIsFullscreen';
@@ -24,6 +25,10 @@ export function HeaderSize({
return (
<div
data-tauri-drag-region
onDoubleClick={async () => {
// Maximize window on double-click
await getCurrentWebviewWindow().toggleMaximize();
}}
style={{
...style,
// Add padding for macOS stoplights, but keep it the same width (account for the interface scale)