mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-19 23:31:21 +02:00
Maximize window on header double-click
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
import { getCurrentWebviewWindow } from '@tauri-apps/api/webviewWindow';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import type { HTMLAttributes, ReactNode } from 'react';
|
import type { HTMLAttributes, ReactNode } from 'react';
|
||||||
import { useIsFullscreen } from '../hooks/useIsFullscreen';
|
import { useIsFullscreen } from '../hooks/useIsFullscreen';
|
||||||
@@ -24,6 +25,10 @@ export function HeaderSize({
|
|||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
data-tauri-drag-region
|
data-tauri-drag-region
|
||||||
|
onDoubleClick={async () => {
|
||||||
|
// Maximize window on double-click
|
||||||
|
await getCurrentWebviewWindow().toggleMaximize();
|
||||||
|
}}
|
||||||
style={{
|
style={{
|
||||||
...style,
|
...style,
|
||||||
// Add padding for macOS stoplights, but keep it the same width (account for the interface scale)
|
// Add padding for macOS stoplights, but keep it the same width (account for the interface scale)
|
||||||
|
|||||||
Reference in New Issue
Block a user