mirror of
https://github.com/wailsapp/wails.git
synced 2026-03-14 14:45:49 +01:00
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:
parent
6b8c8d495f
commit
618489800c
2 changed files with 12 additions and 1 deletions
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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 -->
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue