5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-03 10:41:14 +08:00
wails/v3/pkg/application/options_webview_window.go
Lea Anthony 045a830fbc
Add "DragAndDropEnabled" option for window
Add "FileDraggingExited" event
2023-02-15 18:56:52 +11:00

64 lines
1.7 KiB
Go

package application
import (
"io/fs"
"net/http"
)
type WindowState int
const (
WindowStateNormal WindowState = iota
WindowStateMinimised
WindowStateMaximised
WindowStateFullscreen
)
type WebviewWindowOptions struct {
Name string
Title string
Width, Height int
AlwaysOnTop bool
URL string
DisableResize bool
Frameless bool
MinWidth int
MinHeight int
MaxWidth int
MaxHeight int
StartState WindowState
Mac MacWindow
BackgroundColour *RGBA
Assets AssetOptions
HTML string
JS string
CSS string
X int
Y int
FullscreenButtonEnabled bool
Hidden bool
EnableFraudulentWebsiteWarnings bool
Zoom float64
EnableDragAndDrop bool
}
var WebviewWindowDefaults = &WebviewWindowOptions{
Title: "",
Width: 800,
Height: 600,
URL: "",
}
type AssetOptions struct {
// FS to use for loading assets from
FS fs.FS
// Handler is a custom handler to use for serving assets. If this is set, the `URL` and `FS` fields are ignored.
Handler http.Handler
// Middleware is a custom middleware to use for serving assets. If this is set, the `URL` and `FS` fields are ignored.
Middleware func(http.Handler) http.Handler
}
type RGBA struct {
Red, Green, Blue, Alpha uint8
}