LavaUI docs

struct WindowControlsStyle

Swift

struct WindowControlsStyle

Colours and metrics for a control cluster.

The defaults are the traffic lights, because they are the arrangement users already read without a legend: the colour says which button it is at a glance and at any size, and the glyph is confirmation rather than the label. Every field is open, so an app whose palette this fights can restate it without reimplementing hit testing or the compositor calls.

Sources/LavaUI/WindowControls.swift:147

Constructors

init(size: Float = 12, spacing: Float = 8, close: Color = Color(r: 1.0, g: 0.37, b: 0.34), minimize: Color = Color(r: 1.0, g: 0.74, b: 0.18), maximize: Color = Color(r: 0.16, g: 0.78, b: 0.25), pressedDim: Float = 0.75, glyph: Color = Color(r: 0.15, g: 0.12, b: 0.1, a: 0.85), glyphOnHoverOnly: Bool = true)

Not documented.

Sources/LavaUI/WindowControls.swift:164

Properties

var close: Color

Not documented.

Sources/LavaUI/WindowControls.swift:152

var glyph: Color

The glyph drawn inside a control while the cluster is hovered.

Sources/LavaUI/WindowControls.swift:159

var glyphOnHoverOnly: Bool

Whether the glyphs appear only on hover. False draws them always, which suits a dense toolbar where the cluster is small.

Sources/LavaUI/WindowControls.swift:162

var maximize: Color

Not documented.

Sources/LavaUI/WindowControls.swift:154

var minimize: Color

Not documented.

Sources/LavaUI/WindowControls.swift:153

var pressedDim: Float

Fill while the pointer is down on a control. A darkened version of the control's own colour reads as "pressed" without a second palette.

Sources/LavaUI/WindowControls.swift:157

var size: Float

Diameter of one control, in points.

Sources/LavaUI/WindowControls.swift:149

var spacing: Float

Gap between controls.

Sources/LavaUI/WindowControls.swift:151

Methods

static func monochrome(size: Float = 12, spacing: Float = 8, color: Color? = nil) -> WindowControlsStyle

One flat colour for all three, for chrome that would rather not shout. The glyph still says which is which, so it is drawn unconditionally.

Sources/LavaUI/WindowControls.swift:186