5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-04 23:41:38 +08:00
wails/v3/pkg/application/options_webview_window.go

81 lines
2.2 KiB
Go

package application
type WindowState int
const (
WindowStateNormal WindowState = iota
WindowStateMinimised
WindowStateMaximised
WindowStateFullscreen
)
type WebviewWindowOptions struct {
Name string
Title string
Width int
Height int
AlwaysOnTop bool
URL string
DisableResize bool
Frameless bool
MinWidth int
MinHeight int
MaxWidth int
MaxHeight int
StartState WindowState
Centered bool
BackgroundType BackgroundType
BackgroundColour RGBA
HTML string
JS string
CSS string
X int
Y int
FullscreenButtonEnabled bool
Hidden bool
EnableFraudulentWebsiteWarnings bool
Zoom float64
ZoomControlEnabled bool
EnableDragAndDrop bool
OpenInspectorOnStartup bool
Mac MacWindow
Windows WindowsWindow
Focused bool
Menu *Menu
// ShouldClose is called when the window is about to close.
// Return true to allow the window to close, or false to prevent it from closing.
ShouldClose func(window *WebviewWindow) bool
// If true, the window's devtools will be available (default true in builds without the `production` build tag)
DevToolsEnabled bool
// If true, the window's default context menu will be disabled (default false)
DefaultContextMenuDisabled bool
}
var WebviewWindowDefaults = &WebviewWindowOptions{
Title: "",
Width: 800,
Height: 600,
URL: "",
BackgroundColour: RGBA{
Red: 255,
Green: 255,
Blue: 255,
Alpha: 255,
},
}
type RGBA struct {
Red, Green, Blue, Alpha uint8
}
type BackgroundType int
const (
BackgroundTypeSolid BackgroundType = iota
BackgroundTypeTransparent
BackgroundTypeTranslucent
)