SpinnerNode
Namespace: Hex1b
Assembly: Hex1b.dll
Render node for displaying animated spinners. Created by reconciling a .
public sealed class SpinnerNode : Hex1bNodeInheritance
Object → Hex1bNode → SpinnerNode
Properties
ExplicitFrameIndex
Gets or sets an explicit frame index for manual control. When null, the spinner uses time-based animation.
Returns: Nullable<Int32>
public int? ExplicitFrameIndex { get; set; }Style
Gets or sets the explicit spinner style, or null to use theme default.
Returns: SpinnerStyle
public SpinnerStyle? Style { get; set; }Methods
GetTimeUntilNextFrame()
Gets the time until the next frame transition for scheduling redraws.
Returns: TimeSpan
public TimeSpan GetTimeUntilNextFrame()MeasureCore(Constraints)
Measures the size required for the spinner.
Parameters:
constraints(Constraints): The size constraints for layout.
Returns: Size
The measured size based on the current frame's display width.
protected override Size MeasureCore(Constraints constraints)Render(Hex1bRenderContext)
Renders the spinner to the terminal.
Parameters:
context(Hex1bRenderContext): The render context providing terminal access and theming.
public override void Render(Hex1bRenderContext context)Remarks
SpinnerNode handles measuring and rendering spinner frames. The spinner style is resolved from the widget's explicit style or the theme's default.
Animation is time-based: the node tracks when it started and calculates the current frame based on elapsed time and the style's interval. This ensures consistent animation speed regardless of how often the screen is redrawn.
This node is not focusable and does not handle input. It is a display-only widget.