mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-04 02:51:56 +08:00
[v2] Add WindowGetPos & WindowGetSize
This commit is contained in:
parent
3edbda313e
commit
4e68f92083
@ -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…
Reference in New Issue
Block a user