docs: add examples for window X/Y coordinate options (#4817)

* docs: add examples for window X/Y coordinate options

* Update UNRELEASED_CHANGELOG.md
This commit is contained in:
ruhuang 2025-12-20 12:50:32 +08:00 committed by GitHub
commit 618489800c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 12 additions and 1 deletions

View file

@ -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()

View file

@ -20,6 +20,7 @@ After processing, the content will be moved to the main changelog and this file
## Changed
<!-- Changes in existing functionality -->
- Update the documentation for Window `X/Y` options @ruhuang2001
## Fixed
<!-- Bug fixes -->