fix: align macOS header controls
This commit is contained in:
@@ -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(),
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user