options

package
v2.0.0-beta.44.2 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Default = &App{
	Width:              1024,
	Height:             768,
	Logger:             logger.NewDefaultLogger(),
	LogLevel:           logger.INFO,
	LogLevelProduction: logger.ERROR,
	CSSDragProperty:    "--wails-draggable",
	CSSDragValue:       "drag",
}

Default options for creating the App

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
	// RGBA is deprecated. Please use BackgroundColour
	RGBA               *RGBA
	Assets             fs.FS
	AssetsHandler      http.Handler
	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{}
	WindowStartState   WindowStartState

	// 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

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

	// Experimental options
	Experimental *Experimental
}

App contains options for creating the App

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 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