Documentation
¶
Overview ¶
Package look sets the platform look of a gowt app: the window material, macOS 26 Liquid Glass, Windows 11 corners and dark content. Every call does nothing on a system without the feature.
Index ¶
- func Classic()
- func GlassButton() gowt.Option
- func SetBackdrop(w *gowt.Window, b Backdrop)
- func SetDarkContent(a *gowt.App, on bool)
- func SetFullSizeContent(w *gowt.Window, on bool)
- func SetGlass(c Container, on bool)
- func SetGlassGroup(c Container, spacing float64)
- func SetRoundedCorners(w *gowt.Window, on bool)
- func SetToolbar(w *gowt.Window, items ...ToolbarItem) bool
- type Backdrop
- type Container
- type ToolbarItem
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Classic ¶
func Classic()
Classic asks macOS 26 and newer to keep the look of earlier releases instead of Liquid Glass (the UIDesignRequiresCompatibility key). Call it before gowt.Run. Other systems ignore it. Without an Info.plist the key can only be set at run time and macOS may not read it there; building with -ldflags=-macsdk=15.0 records an older SDK in the binary, which is reliable.
func GlassButton ¶
GlassButton gives a push button (not Check, Radio, Toggle or Arrow) the Liquid Glass bezel on macOS 26 and newer; elsewhere the button is unchanged.
func SetBackdrop ¶
SetBackdrop sets the window material. A value the OS cannot show falls back to the nearest one it can; Linux ignores it.
func SetDarkContent ¶
SetDarkContent on Windows turns on the dark theme of the window content (scroll bars, tables, trees, buttons) through undocumented uxtheme exports. Call before creating windows; it does not switch live. GTK and AppKit theme the content themselves, so it does nothing there.
func SetFullSizeContent ¶
SetFullSizeContent lets the window content extend under the title bar, which becomes transparent, so backgrounds and glass run under it. The window layout (Grid, Row, Form) gets the title bar and toolbar height as extra top margin, kept in step on resize, SetToolbar and full screen; other layouts need their own margin. macOS only; elsewhere it does nothing.
func SetGlass ¶
SetGlass puts a Liquid Glass surface behind the container's content, with rounded corners; the container and its children stop painting their own background. It needs macOS 26; older macOS shows a blurred material, other systems nothing.
func SetGlassGroup ¶
SetGlassGroup makes the glass surfaces (SetGlass) of the direct children of c share one NSGlassEffectContainerView, so surfaces closer than spacing points merge into one shape. Call it before the children get their glass. macOS 26 only; elsewhere it does nothing.
func SetRoundedCorners ¶
SetRoundedCorners forces rounded (true) or square (false) window corners on Windows 11; other systems and older Windows builds ignore it. Windows 11 rounds top-level windows by default.
func SetToolbar ¶
func SetToolbar(w *gowt.Window, items ...ToolbarItem) bool
SetToolbar puts a native unified toolbar (NSToolbar) on the window, replacing an earlier one; with no items it removes the toolbar. On macOS 26 the items are Liquid Glass. It reports whether the toolbar exists: elsewhere nothing is created and the result is false, so build your own gowt.ToolBar in that case. Use it together with SetFullSizeContent only if the content leaves room for the bar.
Types ¶
type Container ¶
Container is a gowt container that has a composite: Panel, Window, Group, Split and CoolBar.
type ToolbarItem ¶
type ToolbarItem struct {
Title string // label and tooltip
Symbol string // SF Symbol name such as "plus" or "square.and.arrow.up"; "" shows the title only
OnClick func()
Space bool // flexible space; the other fields are ignored
}
ToolbarItem is one entry of the window toolbar.