From 618489800cb60881d152a881558fcecd179a8d99 Mon Sep 17 00:00:00 2001 From: ruhuang Date: Sat, 20 Dec 2025 12:50:32 +0800 Subject: [PATCH] docs: add examples for window X/Y coordinate options (#4817) * docs: add examples for window X/Y coordinate options * Update UNRELEASED_CHANGELOG.md --- docs/src/content/docs/features/windows/options.mdx | 12 +++++++++++- v3/UNRELEASED_CHANGELOG.md | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/docs/src/content/docs/features/windows/options.mdx b/docs/src/content/docs/features/windows/options.mdx index 0b278e651..521d50b01 100644 --- a/docs/src/content/docs/features/windows/options.mdx +++ b/docs/src/content/docs/features/windows/options.mdx @@ -158,7 +158,17 @@ Y: 100, // 100px from top edge - Positive X goes right - Positive Y goes down -**Best practice:** Use `Center()` instead: +**Example:** + +```go +settings := app.NewWebviewWindowWithOptions(application.WebviewWindowOptions{ + Name: "coordinate-window", + InitialPosition: application.WindowXY, // use coordinate system + X: 100, + Y: 100, +}) + +**Best practice:** Use `Center()` to center the window: ```go window := app.NewWebviewWindow() diff --git a/v3/UNRELEASED_CHANGELOG.md b/v3/UNRELEASED_CHANGELOG.md index 8e4648038..0123dbe00 100644 --- a/v3/UNRELEASED_CHANGELOG.md +++ b/v3/UNRELEASED_CHANGELOG.md @@ -20,6 +20,7 @@ After processing, the content will be moved to the main changelog and this file ## Changed +- Update the documentation for Window `X/Y` options @ruhuang2001 ## Fixed