fix: align macOS header controls

This commit is contained in:
lucaronin
2026-05-02 00:02:48 +02:00
parent bb09fcfd6f
commit 802b6b77d9
25 changed files with 443 additions and 27 deletions

View File

@@ -2,6 +2,8 @@ import { isTauri } from '../mock-tauri'
import { shouldUseLinuxWindowChrome } from './platform'
import { rememberNoteWindowParams } from './windowMode'
const MACOS_TRAFFIC_LIGHT_POSITION = { x: 18, y: 24 } as const
export function buildNoteWindowUrl(notePath: string, vaultPath: string, noteTitle: string, windowLabel?: string): string {
const params = new URLSearchParams({
window: 'note',
@@ -24,6 +26,7 @@ export function buildNoteWindowUrl(notePath: string, vaultPath: string, noteTitl
export async function openNoteInNewWindow(notePath: string, vaultPath: string, noteTitle: string): Promise<void> {
if (!isTauri()) return
const { LogicalPosition } = await import('@tauri-apps/api/dpi')
const { WebviewWindow } = await import('@tauri-apps/api/webviewWindow')
const label = `note-${Date.now()}`
rememberNoteWindowParams(label, { notePath, vaultPath, noteTitle })
@@ -35,6 +38,7 @@ export async function openNoteInNewWindow(notePath: string, vaultPath: string, n
height: 700,
resizable: true,
titleBarStyle: 'overlay',
trafficLightPosition: new LogicalPosition(MACOS_TRAFFIC_LIGHT_POSITION.x, MACOS_TRAFFIC_LIGHT_POSITION.y),
hiddenTitle: true,
decorations: !shouldUseLinuxWindowChrome(),
})