options

package
v2.9.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 18, 2024 License: MIT Imports: 13 Imported by: 251

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MergeDefaults

func MergeDefaults(appoptions *App)

MergeDefaults will set the minimum default values for an application

Types

type App

type App struct {
	Title             string
	Width             int
	Height            int
	DisableResize     bool
	Fullscreen        bool
	Frameless         bool
	MinWidth          int
	MinHeight         int
	MaxWidth          int
	MaxHeight         int
	StartHidden       bool
	HideWindowOnClose bool
	AlwaysOnTop       bool
	// BackgroundColour is the background colour of the window
	// You can use the options.NewRGB and options.NewRGBA functions to create a new colour
	BackgroundColour *RGBA
	// Deprecated: Use AssetServer.Assets instead.
	Assets fs.FS
	// Deprecated: Use AssetServer.Handler instead.
	AssetsHandler http.Handler
	// AssetServer configures the Assets for the application
	AssetServer        *assetserver.Options
	Menu               *menu.Menu
	Logger             logger.Logger `json:"-"`
	LogLevel           logger.LogLevel
	LogLevelProduction logger.LogLevel
	OnStartup          func(ctx context.Context)                `json:"-"`
	OnDomReady         func(ctx context.Context)                `json:"-"`
	OnShutdown         func(ctx context.Context)                `json:"-"`
	OnBeforeClose      func(ctx context.Context) (prevent bool) `json:"-"`
	Bind               []interface{}
	EnumBind           []interface{}
	WindowStartState   WindowStartState

	// ErrorFormatter overrides the formatting of errors returned by backend methods
	ErrorFormatter ErrorFormatter

	// CSS property to test for draggable elements. Default "--wails-draggable"
	CSSDragProperty string

	// The CSS Value that the CSSDragProperty must have to be draggable, EG: "drag"
	CSSDragValue string

	// EnableDefaultContextMenu enables the browser's default context-menu in production
	// This menu is already enabled in development and debug builds
	EnableDefaultContextMenu bool

	// EnableFraudulentWebsiteDetection enables scan services for fraudulent content, such as malware or phishing attempts.
	// These services might send information from your app like URLs navigated to and possibly other content to cloud
	// services of Apple and Microsoft.
	EnableFraudulentWebsiteDetection bool

	SingleInstanceLock *SingleInstanceLock

	Windows *windows.Options
	Mac     *mac.Options
	Linux   *linux.Options

	// Experimental options
	Experimental *Experimental

	// Debug options for debug builds. These options will be ignored in a production build.
	Debug Debug

	// DragAndDrop options for drag and drop behavior
	DragAndDrop *DragAndDrop
}

App contains options for creating the App

type Debug added in v2.3.0

type Debug struct {
	// OpenInspectorOnStartup opens the inspector on startup of the app.
	OpenInspectorOnStartup bool
}

Debug options which are taken into account in debug builds.

type DragAndDrop added in v2.9.0

type DragAndDrop struct {

	// EnableFileDrop enables wails' drag and drop functionality that returns the dropped in files' absolute paths.
	EnableFileDrop bool

	// Disable webview's drag and drop functionality.
	//
	// It can be used to prevent accidental file opening of dragged in files in the webview, when there is no need for drag and drop.
	DisableWebViewDrop bool

	// CSS property to test for drag and drop target elements. Default "--wails-drop-target"
	CSSDropProperty string

	// The CSS Value that the CSSDropProperty must have to be a valid drop target. Default "drop"
	CSSDropValue string
}

type ErrorFormatter added in v2.6.0

type ErrorFormatter func(error) any

type Experimental

type Experimental struct{}

type RGBA

type RGBA struct {
	R uint8 `json:"r"`
	G uint8 `json:"g"`
	B uint8 `json:"b"`
	A uint8 `json:"a"`
}

func NewRGB

func NewRGB(r, g, b uint8) *RGBA

NewRGB creates a new RGBA struct with the given values and Alpha set to 255

func NewRGBA

func NewRGBA(r, g, b, a uint8) *RGBA

NewRGBA creates a new RGBA struct with the given values

type SecondInstanceData added in v2.7.0

type SecondInstanceData struct {
	Args             []string
	WorkingDirectory string
}

func NewSecondInstanceData added in v2.7.0

func NewSecondInstanceData() (*SecondInstanceData, error)

type SingleInstanceLock added in v2.7.0

type SingleInstanceLock struct {
	// uniqueId that will be used for setting up messaging between instances
	UniqueId               string
	OnSecondInstanceLaunch func(secondInstanceData SecondInstanceData)
}

type WindowStartState

type WindowStartState int
const (
	Normal     WindowStartState = 0
	Maximised  WindowStartState = 1
	Minimised  WindowStartState = 2
	Fullscreen WindowStartState = 3
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL