mirror of
https://github.com/wavetermdev/wails.git
synced 2026-08-05 13:53:43 -07:00
Normalise app/webview options
Update deps
This commit is contained in:
@@ -8,6 +8,19 @@ import (
|
||||
"github.com/wailsapp/wails/v3/internal/assetserver"
|
||||
)
|
||||
|
||||
// ActivationPolicy is the activation policy for the application.
|
||||
type ActivationPolicy int
|
||||
|
||||
const (
|
||||
// ActivationPolicyRegular is used for applications that have a user interface,
|
||||
ActivationPolicyRegular ActivationPolicy = iota
|
||||
// ActivationPolicyAccessory is used for applications that do not have a main window,
|
||||
// such as system tray applications or background applications.
|
||||
ActivationPolicyAccessory
|
||||
ActivationPolicyProhibited
|
||||
)
|
||||
|
||||
// Options contains the options for the application
|
||||
type Options struct {
|
||||
// Name is the name of the application (used in the default about box)
|
||||
Name string
|
||||
@@ -19,13 +32,39 @@ type Options struct {
|
||||
Icon []byte
|
||||
|
||||
// Mac is the Mac specific configuration for Mac builds
|
||||
Mac MacOptions
|
||||
Mac struct {
|
||||
// ActivationPolicy is the activation policy for the application. Defaults to
|
||||
// applicationActivationPolicyRegular.
|
||||
ActivationPolicy ActivationPolicy
|
||||
// If set to true, the application will terminate when the last window is closed.
|
||||
ApplicationShouldTerminateAfterLastWindowClosed bool
|
||||
}
|
||||
|
||||
// Windows is the Windows specific configuration for Windows builds
|
||||
Windows WindowsOptions
|
||||
Windows struct {
|
||||
|
||||
// WndProcInterceptor is a function that will be called for every message sent in the application.
|
||||
// Use this to hook into the main message loop. This is useful for handling custom window messages.
|
||||
// If `shouldReturn` is `true` then `returnCode` will be returned by the main message loop.
|
||||
// If `shouldReturn` is `false` then returnCode will be ignored and the message will be processed by the main message loop.
|
||||
WndProcInterceptor func(hwnd uintptr, msg uint32, wParam, lParam uintptr) (returnCode uintptr, shouldReturn bool)
|
||||
|
||||
// DisableQuitOnLastWindowClosed disables the auto quit of the application if the last window has been closed.
|
||||
DisableQuitOnLastWindowClosed bool
|
||||
|
||||
// Path where the WebView2 stores the user data. If empty %APPDATA%\[BinaryName.exe] will be used.
|
||||
// If the path is not valid, a messagebox will be displayed with the error and the app will exit with error code.
|
||||
WebviewUserDataPath string
|
||||
|
||||
// Path to the directory with WebView2 executables. If empty WebView2 installed in the system will be used.
|
||||
WebviewBrowserPath string
|
||||
}
|
||||
|
||||
// Linux is the Linux specific configuration for Linux builds
|
||||
Linux LinuxOptions
|
||||
Linux struct {
|
||||
// DisableQuitOnLastWindowClosed disables the auto quit of the application if the last window has been closed.
|
||||
DisableQuitOnLastWindowClosed bool
|
||||
}
|
||||
|
||||
// Bind allows you to bind Go methods to the frontend.
|
||||
Bind []any
|
||||
|
||||
Reference in New Issue
Block a user