[v2] Add WindowGetPos & WindowGetSize

This commit is contained in:
Lea Anthony
2021-10-18 21:42:02 +11:00
parent 3edbda313e
commit 4e68f92083

View File

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