Type Metrics

type Metrics struct {
	ControlHeight float32 // buttons, inputs, toggles
	RadiusControl float32 // control corner radius
	RadiusSurface float32 // card and container radius
	FontSizeS     float32 // captions, badges
	FontSizeM     float32 // body and controls
	FontSizeL     float32 // page titles
	PadControlX   float32 // horizontal control padding
	PadSurface    float32 // card interior padding
	GapItem       float32 // row-to-row spacing inside lists
}

Metrics carries the size tokens every component consumes. Derived themes replace these wholesale; components never hardcode geometry.

Constructors

DefaultMetrics#

func DefaultMetrics() Metrics

DefaultMetrics returns the standard desktop density.

Methods

RadiusItem#

func (m Metrics) RadiusItem() float32

RadiusItem is the corner radius of a row inside a menu, list or popup: two pixels tighter than a control, so its corners sit inside the surface's.

RadiusPopup#

func (m Metrics) RadiusPopup() float32

RadiusPopup is the corner radius of a floating surface that holds rows: a menu, a select list, a combobox or command panel. It is one pixel tighter than a dialog or card surface (RadiusSurface).

WithDensity#

func (m Metrics) WithDensity(density Density) Metrics

WithDensity derives a metrics set at another density.