Help us shape the future of Go! Take the 2026 Go Developer Survey

mac

package
v2.17.0 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2026 License: MIT Imports: 1 Imported by: 202

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Enabled  = u.True
	Disabled = u.False
)

Functions

This section is empty.

Types

type AboutInfo

type AboutInfo struct {
	Title   string
	Message string
	Icon    []byte
}

type AppearanceType

type AppearanceType string

AppearanceType is a type of Appearance for Cocoa windows

const (
	// DefaultAppearance uses the default system value
	DefaultAppearance AppearanceType = ""
	// NSAppearanceNameAqua - The standard light system appearance.
	NSAppearanceNameAqua AppearanceType = "NSAppearanceNameAqua"
	// NSAppearanceNameDarkAqua - The standard dark system appearance.
	NSAppearanceNameDarkAqua AppearanceType = "NSAppearanceNameDarkAqua"
	// NSAppearanceNameVibrantLight - The light vibrant appearance
	NSAppearanceNameVibrantLight AppearanceType = "NSAppearanceNameVibrantLight"
	// NSAppearanceNameAccessibilityHighContrastAqua - A high-contrast version of the standard light system appearance.
	NSAppearanceNameAccessibilityHighContrastAqua AppearanceType = "NSAppearanceNameAccessibilityHighContrastAqua"
	// NSAppearanceNameAccessibilityHighContrastDarkAqua - A high-contrast version of the standard dark system appearance.
	NSAppearanceNameAccessibilityHighContrastDarkAqua AppearanceType = "NSAppearanceNameAccessibilityHighContrastDarkAqua"
	// NSAppearanceNameAccessibilityHighContrastVibrantLight - A high-contrast version of the light vibrant appearance.
	NSAppearanceNameAccessibilityHighContrastVibrantLight AppearanceType = "NSAppearanceNameAccessibilityHighContrastVibrantLight"
	// NSAppearanceNameAccessibilityHighContrastVibrantDark - A high-contrast version of the dark vibrant appearance.
	NSAppearanceNameAccessibilityHighContrastVibrantDark AppearanceType = "NSAppearanceNameAccessibilityHighContrastVibrantDark"
)

type Options

type Options struct {
	TitleBar             *TitleBar
	Appearance           AppearanceType
	ContentProtection    bool
	WebviewIsTransparent bool
	WindowIsTranslucent  bool
	Preferences          *Preferences
	DisableZoom          bool
	// ActivationPolicy     ActivationPolicy
	About      *AboutInfo
	OnFileOpen func(filePath string) `json:"-"`
	OnUrlOpen  func(filePath string) `json:"-"`

	// DisableEscapeExitsFullscreen prevents the Escape key from exiting fullscreen mode.
	// When true, web content can handle the Escape key (e.g., to close modals) without
	// triggering the macOS system behaviour that exits the fullscreen window.
	DisableEscapeExitsFullscreen bool
}

Options are options specific to Mac

type Preferences added in v2.7.0

type Preferences struct {
	// A Boolean value that indicates whether pressing the tab key changes the focus to links and form controls.
	// Set to false by default.
	TabFocusesLinks u.Bool
	// A Boolean value that indicates whether to allow people to select or otherwise interact with text.
	// Set to true by default.
	TextInteractionEnabled u.Bool
	// A Boolean value that indicates whether a web view can display content full screen.
	// Set to false by default
	FullscreenEnabled u.Bool
	// A string used as the application name portion of the user agent string.
	// When set to a non-empty value, this overrides the default Wails application
	// name suffix appended to the WKWebView user agent. Useful when sites
	// (e.g. YouTube embed) reject the default identifier. Leave empty to keep
	// Wails' default behaviour.
	ApplicationNameForUserAgent string
	// EnableAutoplayWithoutUserAction allows media to start playing automatically
	// without requiring a user gesture. When unset or false, WebKit's default
	// behaviour is preserved (gesture required).
	// Maps to WKWebViewConfiguration.mediaTypesRequiringUserActionForPlayback.
	EnableAutoplayWithoutUserAction u.Bool
}

Preferences allows to set webkit preferences

type TitleBar

type TitleBar struct {
	TitlebarAppearsTransparent bool
	HideTitle                  bool
	HideTitleBar               bool
	FullSizeContent            bool
	UseToolbar                 bool
	HideToolbarSeparator       bool
}

TitleBar contains options for the Mac titlebar

func TitleBarDefault

func TitleBarDefault() *TitleBar

TitleBarDefault results in the default Mac Titlebar

func TitleBarHidden

func TitleBarHidden() *TitleBar

TitleBarHidden results in a hidden title bar and a full size content window, yet the title bar still has the standard window controls (“traffic lights”) in the top left.

func TitleBarHiddenInset

func TitleBarHiddenInset() *TitleBar

TitleBarHiddenInset results in a hidden title bar with an alternative look where the traffic light buttons are slightly more inset from the window edge.

Jump to

Keyboard shortcuts

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