look

package
v0.9.3 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: EPL-2.0 Imports: 7 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

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 DragsWindow

func DragsWindow(c Container)

DragsWindow makes c a window drag area for a custom title bar (see SetFullSizeContent): a left press on c or on its labels and plain panels moves the window as a title bar would, and a double click zooms (macOS follows the AppleActionOnDoubleClick setting, including minimize and none) or maximizes and restores. On Windows and Linux the double click is a plain maximize toggle, not the window manager's own title bar action, and the move itself is left to the window manager, so details such as edge snapping differ between desktops. Buttons, text fields and other controls, and Canvas, keep their clicks. Children are taken as they are when DragsWindow runs, so call it after building c. macOS, Windows and Linux (X11 and Wayland through GTK 3).

func GlassButton

func GlassButton() gowt.Option

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

func SetBackdrop(w *gowt.Window, b Backdrop)

SetBackdrop sets the window material. A value the OS cannot show falls back to the nearest one it can; Linux ignores it.

func SetDarkContent

func SetDarkContent(a *gowt.App, on bool)

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

func SetFullSizeContent(w *gowt.Window, on bool)

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

func SetGlass(c Container, on bool)

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

func SetGlassGroup(c Container, spacing float64)

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

func SetRoundedCorners(w *gowt.Window, on bool)

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 SetSidebar

func SetSidebar(w *gowt.Window, sidebar, content Container, width int)

SetSidebar lays w out the way Finder and System Settings are: sidebar on the left, width points wide, content filling the rest. It replaces the window layout, so w must hold just these two. On macOS 26 the sidebar floats: Liquid Glass with rounded corners, inset from the window edges and running under the traffic lights; the window gets full-size content, sidebar children and content start below the title bar and toolbar, and the items and title of SetToolbar start past the sidebar. Older macOS shows a flush sidebar material; Windows and Linux put two plain panels side by side, with the SetToolbar items as a bar above the content. A background on w itself paints over the macOS sidebar glass; colour the content instead.

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 native toolbar exists. Where it does not (Windows, Linux), a window laid out by SetSidebar, before or after this call, gets the items as a bar of gowt widgets at the top of its content column: flat icon buttons, the window title, a search field, in the content's colour. A window without SetSidebar gets nothing there; build your own gowt.ToolBar in that case. Use it together with SetFullSizeContent only if the content leaves room for the bar.

Types

type Backdrop

type Backdrop int

Backdrop is the material behind a window's content.

const (
	BackdropNone        Backdrop = iota // opaque, the platform default
	BackdropTranslucent                 // blurred desktop behind the window: NSVisualEffectView, Acrylic
	BackdropGlass                       // Liquid Glass on macOS 26, Mica on Windows 11
)

type Container

type Container interface{ AsComposite() *swt.Composite }

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
	// Group makes the item one capsule of segments, such as the back and forward pair; each segment
	// has its own Title, Symbol and OnClick, and the item's own Symbol and OnClick are not used.
	Group []ToolbarItem
	// Nav places the item at the leading edge before the window title, where back and forward go.
	Nav bool
	// Sidebar places the item over the sidebar of a SetSidebar window, ending at the sidebar edge: on
	// macOS in the title bar, level with the traffic lights (Finder, Mail), on Windows and Linux in a row
	// at the top of the sidebar. Without SetSidebar it is an ordinary item.
	Sidebar bool
	// OnSearch makes the item a search field (NSSearchToolbarItem) with Title as the placeholder. It
	// gets the text after a typing pause, on Return and on clearing.
	OnSearch func(text string)
	// Enabled, when set, enables and disables a push item or a Group segment as it changes, for as
	// long as the toolbar stays; nil keeps the item enabled.
	Enabled rx.Reader[bool]
}

ToolbarItem is one entry of the window toolbar.

Jump to

Keyboard shortcuts

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