mirror of
https://github.com/wailsapp/wails.git
synced 2026-03-14 14:45:49 +01:00
[v2] Add WindowGetPos & WindowGetSize
This commit is contained in:
parent
3edbda313e
commit
4e68f92083
1 changed files with 11 additions and 0 deletions
|
|
@ -2,6 +2,7 @@ package runtime
|
|||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/wailsapp/wails/v2/pkg/options"
|
||||
)
|
||||
|
||||
|
|
@ -53,6 +54,11 @@ func WindowSetSize(ctx context.Context, width int, height int) {
|
|||
appFrontend.WindowSetSize(width, height)
|
||||
}
|
||||
|
||||
func WindowGetSize(ctx context.Context) (int, int) {
|
||||
appFrontend := getFrontend(ctx)
|
||||
return appFrontend.WindowGetSize()
|
||||
}
|
||||
|
||||
// WindowSetMinSize sets the minimum size of the window
|
||||
func WindowSetMinSize(ctx context.Context, width int, height int) {
|
||||
appFrontend := getFrontend(ctx)
|
||||
|
|
@ -71,6 +77,11 @@ func WindowSetPosition(ctx context.Context, x int, y int) {
|
|||
appFrontend.WindowSetPos(x, y)
|
||||
}
|
||||
|
||||
func WindowGetPos(ctx context.Context) (int, int) {
|
||||
appFrontend := getFrontend(ctx)
|
||||
return appFrontend.WindowGetPos()
|
||||
}
|
||||
|
||||
// WindowMaximise the window
|
||||
func WindowMaximise(ctx context.Context) {
|
||||
appFrontend := getFrontend(ctx)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue