Skip to content
Version 2.11.0
↓ Get the launcher

ButtonElement record

Clickable button. Enabled null = always enabled. Style null = the chrome’s active IChromeStyle default. Active (poll-diffed) renders the accent/filled look when true — used for active tab / toggle-button highlighting. Width > 0 fixes the button width (it can’t grow/shrink) and WRAPS its label — use for right-aligned cells (e.g. a hotkey binding) that must never overflow the row regardless of font metrics. Icon (optional PNG) renders a leading icon INSIDE the button, co-centred with the label by the button’s own layout (so icon↔label alignment can’t drift with font metrics — used by the Settings hub’s iconed tabs).

public record ButtonElement : IEquatable<HudElement>
name description
ButtonElement(…) Clickable button. Enabled null = always enabled. Style null = the chrome’s active IChromeStyle default. Active (poll-diffed) renders the accent/filled look when true — used for active tab / toggle-button highlighting. Width > 0 fixes the button width (it can’t grow/shrink) and WRAPS its label — use for right-aligned cells (e.g. a hotkey binding) that must never overflow the row regardless of font metrics. Icon (optional PNG) renders a leading icon INSIDE the button, co-centred with the label by the button’s own layout (so icon↔label alignment can’t drift with font metrics — used by the Settings hub’s iconed tabs).
Active { get; set; }
Enabled { get; set; }
Icon { get; set; }
Label { get; set; }
OnClick { get; set; }
OnClickWithRect { get; set; } When non-null, invoked on click with the button’s screen rect (top-left origin, same coordinate space as Rect). Use to anchor a popup to the button’s actual position.
Style { get; set; }
Width { get; set; }