Skip to content
Version 2.32.0
↓ Get the launcher

DropdownElement record

Compact dropdown for a small, fixed set of mutually-exclusive choices (e.g. a mode selector) — a reusable replacement for a click-to-cycle button. The trigger shows the current option (caption + ▾); a click opens a themed floating option list that floats above the window’s scroll clip. Picking an option calls OnSelect with its index; the list dismisses on pick, outside-click, or Esc.

public record DropdownElement : IEquatable<HudElement>
name description
DropdownElement(…) Compact dropdown for a small, fixed set of mutually-exclusive choices (e.g. a mode selector) — a reusable replacement for a click-to-cycle button. The trigger shows the current option (caption + ▾); a click opens a themed floating option list that floats above the window’s scroll clip. Picking an option calls OnSelect with its index; the list dismisses on pick, outside-click, or Esc.
CornerRadius { get; set; } Corner radius in px of the Pill trigger. 0 (default) = the trigger keeps its current look (the shared small chip rounding), so existing Pill dropdowns are unchanged; a positive value draws the trigger’s fill (rest and hover) at that radius. Any value ≥ 13 gives a full capsule that matches the house pill buttons (so 14 is fine too): the framework caps the radius at height/2 − 1, because the sliced fill’s minimum size is 2r+2 and a radius of 14 would grow the 28 px trigger to 30 px. The option list is not affected. Ignored by Classic. An init property (NOT a primary-ctor parameter) so the record stays source AND binary compatible with already-compiled plugins; a plugin that sets it needs framework ≥2.29.0.
FillColorFn { get; set; } Optional Pill trigger fill at rest, polled every refresh (final colour — apply any window-opacity fade yourself). null (default) = the built-in neutral pill fill, so existing dropdowns are unchanged. Ignored by Classic; the option list is not affected. init → binary-safe; a plugin that sets it needs framework ≥2.30.0.
HoverFillColorFn { get; set; } Optional Pill trigger fill while hovered, polled every refresh. null = the built-in hover wash (text colour at 8 %) over the rest fill — FillColorFn when set. Same rules as FillColorFn.
LabelColorFn { get; set; } Optional Pill caption colour, polled every refresh; the ▾ follows it. null = the built-in caption (theme text, contrast-checked against the fill) and the muted ▾. Same rules as FillColorFn.
MaxVisibleRows { get; set; } Maximum option rows shown before the floating list becomes vertically scrollable: when the live option count exceeds this, the popup height is capped at about this many rows and a themed thin scrollbar (the same one ScrollElement uses) appears. 0 (default) = unlimited — the list grows to fit every option exactly as before, so existing dropdowns are unchanged. An init property (NOT a primary-ctor parameter) so the record stays source AND binary compatible with already-compiled plugins — see WindowBuilder-Patterns.md “Binary compatibility rules for HudElement records”.
OnSelect { get; set; } Invoked with the picked option’s index.
Options { get; set; } Option captions in order; the index passed to OnSelect indexes this list.
Selected { get; set; } Current selected index (poll-diffed); out of range → empty caption.
Style { get; set; } Visual style. Classic (default) = the themed button trigger and bordered option list, exactly as before, so existing dropdowns are unchanged. Pill = the Stellar house-style look: a 28 px rounded neutral pill (bold caption + muted ▾) and a rounded option panel with an accent-washed selected row; colours follow the live theme. Behaviour (positioning, dismiss, MaxVisibleRows) is identical in both. An init property (NOT a primary-ctor parameter) so the record stays source AND binary compatible with already-compiled plugins — see WindowBuilder-Patterns.md “Binary compatibility rules for HudElement records”.
Width { get; set; } Fixed trigger width in px; 0 → sized to the current caption like a normal button.