5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-02 05:30:22 +08:00
wails/v3/pkg/options/window.go
Lea Anthony 5dbda4aead
Feature: AssetServer Runtime (#2335)
* Tidy up runtime JS

* Initial implementation of runtime over http

* Update runtime deps. Fix test task.

* Support Clipboard.
Message Processor refactor.

* Add `Window.Screen()`
Clipboard `GetText` -> `Text`

* Support most dialogs
Better JS->Go object mapping
Implement Go->JS callback mechanism
Rename `window.runtime` -> `window.wails` to better reflect the Go API

* Support SaveFile dialog

* Remove go.work

* Tidy up

* Event->CustomEvent to prevent potential clash with native JS Event object
Support Eventing

* Support application calls

* Support logging

* Support named windows
Remove debug info

* Update v3 changes
2023-02-06 20:50:11 +11:00

63 lines
1.6 KiB
Go

package options
import (
"io/fs"
"net/http"
)
type WindowState int
const (
WindowStateNormal WindowState = iota
WindowStateMinimised
WindowStateMaximised
WindowStateFullscreen
)
type WebviewWindow 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 Assets
HTML string
JS string
CSS string
X int
Y int
FullscreenButtonEnabled bool
Hidden bool
EnableFraudulentWebsiteWarnings bool
Zoom float64
}
var WindowDefaults = &WebviewWindow{
Title: "",
Width: 800,
Height: 600,
URL: "",
}
type Assets 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
}