Files

113 lines
2.8 KiB
Go
Raw Permalink Normal View History

2021-07-25 15:37:30 +10:00
package runtime
import (
"context"
2021-10-18 21:42:02 +11:00
2021-09-12 16:32:43 +10:00
"github.com/wailsapp/wails/v2/pkg/options"
)
2021-07-25 15:37:30 +10:00
// WindowSetTitle sets the title of the window
func WindowSetTitle(ctx context.Context, title string) {
2021-08-15 21:07:34 +10:00
appFrontend := getFrontend(ctx)
appFrontend.WindowSetTitle(title)
}
2021-07-25 15:37:30 +10:00
// WindowFullscreen makes the window fullscreen
func WindowFullscreen(ctx context.Context) {
2021-08-15 21:07:34 +10:00
appFrontend := getFrontend(ctx)
appFrontend.WindowFullscreen()
}
2021-07-25 15:37:30 +10:00
// WindowUnFullscreen makes the window UnFullscreen
func WindowUnFullscreen(ctx context.Context) {
2021-08-15 21:07:34 +10:00
appFrontend := getFrontend(ctx)
appFrontend.WindowUnFullscreen()
}
2021-07-25 15:37:30 +10:00
// WindowCenter the window on the current screen
func WindowCenter(ctx context.Context) {
2021-08-15 21:07:34 +10:00
appFrontend := getFrontend(ctx)
appFrontend.WindowCenter()
}
// WindowReload will reload the window contents
func WindowReload(ctx context.Context) {
appFrontend := getFrontend(ctx)
appFrontend.WindowReload()
}
2021-07-25 15:37:30 +10:00
// WindowShow shows the window if hidden
func WindowShow(ctx context.Context) {
2021-08-15 21:07:34 +10:00
appFrontend := getFrontend(ctx)
appFrontend.WindowShow()
}
2021-07-25 15:37:30 +10:00
// WindowHide the window
func WindowHide(ctx context.Context) {
2021-08-15 21:07:34 +10:00
appFrontend := getFrontend(ctx)
appFrontend.WindowHide()
}
2021-07-25 15:37:30 +10:00
// WindowSetSize sets the size of the window
func WindowSetSize(ctx context.Context, width int, height int) {
2021-08-15 21:07:34 +10:00
appFrontend := getFrontend(ctx)
appFrontend.WindowSetSize(width, height)
}
2021-10-18 21:42:02 +11:00
func WindowGetSize(ctx context.Context) (int, int) {
appFrontend := getFrontend(ctx)
return appFrontend.WindowGetSize()
}
2021-08-15 21:07:34 +10:00
// WindowSetMinSize sets the minimum size of the window
2021-07-25 15:37:30 +10:00
func WindowSetMinSize(ctx context.Context, width int, height int) {
2021-08-15 21:07:34 +10:00
appFrontend := getFrontend(ctx)
appFrontend.WindowSetMinSize(width, height)
}
2021-08-15 21:07:34 +10:00
// WindowSetMaxSize sets the maximum size of the window
2021-07-25 15:37:30 +10:00
func WindowSetMaxSize(ctx context.Context, width int, height int) {
2021-08-15 21:07:34 +10:00
appFrontend := getFrontend(ctx)
appFrontend.WindowSetMaxSize(width, height)
}
2021-07-25 15:37:30 +10:00
// WindowSetPosition sets the position of the window
func WindowSetPosition(ctx context.Context, x int, y int) {
2021-08-15 21:07:34 +10:00
appFrontend := getFrontend(ctx)
appFrontend.WindowSetPos(x, y)
}
2021-10-18 21:42:02 +11:00
func WindowGetPos(ctx context.Context) (int, int) {
appFrontend := getFrontend(ctx)
return appFrontend.WindowGetPos()
}
2021-07-25 15:37:30 +10:00
// WindowMaximise the window
func WindowMaximise(ctx context.Context) {
2021-08-15 21:07:34 +10:00
appFrontend := getFrontend(ctx)
appFrontend.WindowMaximise()
}
2021-07-25 15:37:30 +10:00
// WindowUnmaximise the window
func WindowUnmaximise(ctx context.Context) {
2021-08-15 21:07:34 +10:00
appFrontend := getFrontend(ctx)
appFrontend.WindowUnmaximise()
}
2021-07-25 15:37:30 +10:00
// WindowMinimise the window
func WindowMinimise(ctx context.Context) {
2021-08-15 21:07:34 +10:00
appFrontend := getFrontend(ctx)
appFrontend.WindowMinimise()
}
2021-07-25 15:37:30 +10:00
// WindowUnminimise the window
func WindowUnminimise(ctx context.Context) {
2021-08-15 21:07:34 +10:00
appFrontend := getFrontend(ctx)
appFrontend.WindowUnminimise()
}
2021-09-12 16:32:43 +10:00
func WindowSetRGBA(ctx context.Context, col *options.RGBA) {
appFrontend := getFrontend(ctx)
appFrontend.WindowSetRGBA(col)
}