Skip to main content

Spinner class

Namespace: Arlecchino.Widgets.Readouts · Assembly: Arlecchino

A one-cell animation for work of unknown length. It does not run on its own: something has to step it, which keeps the framework free of timers the application did not ask for.

public sealed class Spinner : IArlecchinoWidget

Implements IArlecchinoWidget

Constructors

MemberSummary
Spinner()

Properties

MemberSummary
CurrentThe frame to draw right now.
FramesThe frames cycled through. Braille dots by default, which most terminals render in one cell.
StyleColor to draw in. The theme's informational color when left alone.

Methods

MemberSummary
Advance()Moves to the next frame, wrapping at the end.
Draw(SurfaceRegion)Draws the current frame in the first cell of the region and returns the rows below it. One cell is all a spinner needs, so hand over the cell it belongs in — region.Rows(0, 1), a column split, or whatever the layout gives.

Constructors in detail

Spinner()

public Spinner();

Properties in detail

Current

public string Current { get; }

The frame to draw right now.

Type string

Frames

public string[] Frames { get; init; }

The frames cycled through. Braille dots by default, which most terminals render in one cell.

Type string[]

Style

public IArlecchinoColor? Style { get; init; }

Color to draw in. The theme's informational color when left alone.

Type IArlecchinoColor

Methods in detail

Advance()

public void Advance();

Moves to the next frame, wrapping at the end.

Draw(SurfaceRegion)

public SurfaceRegion Draw(SurfaceRegion region);

Draws the current frame in the first cell of the region and returns the rows below it. One cell is all a spinner needs, so hand over the cell it belongs in — region.Rows(0, 1), a column split, or whatever the layout gives.

Parameters

NameTypeDescription
regionSurfaceRegionWhere to draw; the top-left cell is used.

Returns SurfaceRegion — The region below the spinner's row.