Skip to content

InfoBarSectionWidget

Namespace: Hex1b.Widgets

Assembly: Hex1b.dll

A section within an info bar that contains content (text or widgets). Sections can have custom colors, width hints, and alignment.

csharp
public sealed record InfoBarSectionWidget : IInfoBarChild, IEquatable<InfoBarSectionWidget>

Inheritance

ObjectInfoBarSectionWidget

Implements

Constructors

InfoBarSectionWidget(Hex1bWidget, Hex1bColor?, Hex1bColor?)

A section within an info bar that contains content (text or widgets). Sections can have custom colors, width hints, and alignment.

Parameters:

csharp
public InfoBarSectionWidget(Hex1bWidget Content, Hex1bColor? Foreground = null, Hex1bColor? Background = null)

Properties

Alignment

The alignment of content within this section.

Returns: InfoBarSectionAlignment

csharp
public InfoBarSectionAlignment Alignment { get; init; }

Background

Optional background color override.

Returns: Nullable<Hex1bColor>

csharp
public Hex1bColor? Background { get; init; }

Content

The widget content to display in this section.

Returns: Hex1bWidget

csharp
public Hex1bWidget Content { get; init; }

Foreground

Optional foreground color override.

Returns: Nullable<Hex1bColor>

csharp
public Hex1bColor? Foreground { get; init; }

ThemeMutator

Optional theme customization for this section.

Returns: Func<Hex1bTheme, Hex1bTheme>

csharp
public Func<Hex1bTheme, Hex1bTheme>? ThemeMutator { get; init; }

WidthHint

Optional width hint for layout.

Returns: Nullable<SizeHint>

csharp
public SizeHint? WidthHint { get; init; }

Methods

AlignCenter()

Centers content within this section.

Returns: InfoBarSectionWidget

A new section with center alignment.

csharp
public InfoBarSectionWidget AlignCenter()

AlignLeft()

Aligns content to the left within this section.

Returns: InfoBarSectionWidget

A new section with left alignment.

csharp
public InfoBarSectionWidget AlignLeft()

AlignRight()

Aligns content to the right within this section.

Returns: InfoBarSectionWidget

A new section with right alignment.

csharp
public InfoBarSectionWidget AlignRight()

ContentWidth()

Sets this section to size to its content (default behavior).

Returns: InfoBarSectionWidget

A new section with content width.

csharp
public InfoBarSectionWidget ContentWidth()

FillWidth(int)

Sets this section to fill available width with an optional weight.

Parameters:

  • weight (Int32): The fill weight (higher values take more space).

Returns: InfoBarSectionWidget

A new section with fill width.

csharp
public InfoBarSectionWidget FillWidth(int weight = 1)

FixedWidth(int)

Sets this section to a fixed width.

Parameters:

  • width (Int32): The fixed width in characters.

Returns: InfoBarSectionWidget

A new section with fixed width.

csharp
public InfoBarSectionWidget FixedWidth(int width)

Theme(Func<Hex1bTheme, Hex1bTheme>)

Applies custom theme settings to this section.

Parameters:

Returns: InfoBarSectionWidget

A new section with the theme customization.

csharp
public InfoBarSectionWidget Theme(Func<Hex1bTheme, Hex1bTheme> mutator)

Released under the MIT License.