Skip to content

InfoBarWidget

Namespace: Hex1b.Widgets

Assembly: Hex1b.dll

A horizontal info bar widget, typically placed at the bottom of the screen. Supports sections, separators, and spacers with flexible layout options.

csharp
public sealed record InfoBarWidget : Hex1bWidget, IEquatable<Hex1bWidget>, IEquatable<InfoBarWidget>

Inheritance

ObjectHex1bWidgetInfoBarWidget

Implements

Constructors

InfoBarWidget(IReadOnlyList<IInfoBarChild>, bool)

A horizontal info bar widget, typically placed at the bottom of the screen. Supports sections, separators, and spacers with flexible layout options.

Parameters:

  • Children (IReadOnlyList<IInfoBarChild>): The info bar children (sections, separators, spacers).
  • InvertColors (Boolean): Whether to invert foreground/background colors (default: true).
csharp
public InfoBarWidget(IReadOnlyList<IInfoBarChild> Children, bool InvertColors = true)

Properties

Children

The info bar children (sections, separators, spacers).

Returns: IReadOnlyList<IInfoBarChild>

csharp
public IReadOnlyList<IInfoBarChild> Children { get; init; }

DefaultSeparator

The default separator to insert between consecutive sections. When null, no automatic separators are inserted.

Returns: InfoBarSeparatorWidget

csharp
public InfoBarSeparatorWidget? DefaultSeparator { get; init; }

InvertColors

Whether to invert foreground/background colors (default: true).

Returns: Boolean

csharp
public bool InvertColors { get; init; }

Methods

WithDefaultSeparator(string, Hex1bColor?, Hex1bColor?)

Sets the default separator to insert between consecutive sections.

Parameters:

Returns: InfoBarWidget

A new InfoBarWidget with the default separator configured.

csharp
public InfoBarWidget WithDefaultSeparator(string character = " | ", Hex1bColor? foreground = null, Hex1bColor? background = null)

Examples

csharp
// Basic info bar with default separators
ctx.InfoBar(s => [
    s.Section("NORMAL"),
    s.Section("file.cs"),
    s.Section("Ln 42")
]).WithDefaultSeparator(" | ")

// Info bar with spacer to push content right
ctx.InfoBar(s => [
    s.Section("Mode"),
    s.Spacer(),
    s.Section("Ready")
])

Released under the MIT License.