SpinnerElement

io.worxbend.tui.dsl.SpinnerElement
final case class SpinnerElement(elapsed: FiniteDuration, label: String, preset: SpinnerPreset, glyphStyle: Style, labelStyle: Style, props: ElementProps = ...) extends Element

A spinner whose colors were resolved from the ambient Theme at construction.

The theme supplies the glyph and label styles; anything the call site sets with .fg/.bold/.styled layers on top of the glyph style, so spinner(tick).fg(Color.Red) recolors the moving part and leaves the label alone.

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait Element
class Object
trait Matchable
class Any
Show all

Members list

Type members

Types

This node's own type, so a fluent extension gives back what it was handed: progressBar(0.5).fill.bare type-checks because .fill returns a ProgressBarElement, not an abstract Element. Every concrete node fixes it to itself with one line, type Self = ThatNodeType.

This node's own type, so a fluent extension gives back what it was handed: progressBar(0.5).fill.bare type-checks because .fill returns a ProgressBarElement, not an abstract Element. Every concrete node fixes it to itself with one line, type Self = ThatNodeType.

Attributes

Value members

Concrete methods

def atFps(fps: Double): SpinnerElement

Runs the animation at an explicit frame rate.

Runs the animation at an explicit frame rate.

Attributes

override def debugName: String

The factory-style name of this node — panel, button, scrollView — for the element-tree snapshot and any other diagnostic that has to say what a node is without reflecting over its class. Every node type declares its own; a decorator answers with the name of the node it wraps. The default is only there so a node added without one still renders — ElementTreeSnapshotSpec fails the build until the override is written.

The factory-style name of this node — panel, button, scrollView — for the element-tree snapshot and any other diagnostic that has to say what a node is without reflecting over its class. Every node type declares its own; a decorator answers with the name of the node it wraps. The default is only there so a node added without one still renders — ElementTreeSnapshotSpec fails the build until the override is written.

Attributes

Definition Classes
def label(text: String): SpinnerElement

Sets the caption shown after the glyph.

Sets the caption shown after the glyph.

Attributes

def labelStyle(transform: Style => Style): SpinnerElement

Styles the caption independently of the glyph, deriving from whatever the Theme resolved at construction.

Styles the caption independently of the glyph, deriving from whatever the Theme resolved at construction.

.labelStyle(_.dim) dims the themed caption; .labelStyle(_ => someStyle) is the escape hatch for replacing it outright. Taking a transform rather than a Style is what keeps Theme.Light's grey caption grey — a replacing builder silently reverted it to the terminal default.

Attributes

def preset(chosen: SpinnerPreset): SpinnerElement

Swaps the animation — see io.worxbend.tui.widgets.SpinnerPreset for the catalogue.

Swaps the animation — see io.worxbend.tui.widgets.SpinnerPreset for the catalogue.

Attributes

def slowedBy(factor: Double): SpinnerElement

Runs the animation factor times slower than the preset's own speed.

Runs the animation factor times slower than the preset's own speed.

Attributes

def widget: Widget

Inherited methods

def accessibleName: String

What this node is called when it is announced — button Save, checkbox agree — before the interaction states ElementHost.accessibleLabel appends. Defaults to debugName; a node with a label of its own says it.

What this node is called when it is announced — button Save, checkbox agree — before the interaction states ElementHost.accessibleLabel appends. Defaults to debugName; a node with a label of its own says it.

Attributes

Inherited from:
Element
def children: Seq[Element]

Attributes

Inherited from:
Element
def pointerShape: Option[PointerShape]

The mouse pointer this node wants shown over it, when it wants one: the hand over a button or a link, the I-beam over a text field. None leaves the pointer as it is. An explicit .pointer(shape) on the node lands in props.pointerShape and takes precedence; the interactive nodes override this with their own default.

The mouse pointer this node wants shown over it, when it wants one: the hand over a button or a link, the I-beam over a text field. None leaves the pointer as it is. An explicit .pointer(shape) on the node lands in props.pointerShape and takes precedence; the interactive nodes override this with their own default.

Attributes

Inherited from:
Element
def productElementNames: Iterator[String]

An iterator over the names of all the elements of this product.

An iterator over the names of all the elements of this product.

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

An iterator over all the elements of this product.

An iterator over all the elements of this product.

Attributes

Returns

in the default implementation, an Iterator[Any]

Inherited from:
Product
def style(style: Style): Self

This element with style as its own — the content style on every node: a text's text, a list's body, a panel's children and inner area. A container's border is frameStyle instead. The fluent builders (.fg, .bold, .styled(...)) edit the same style rather than replacing it.

This element with style as its own — the content style on every node: a text's text, a list's body, a panel's children and inner area. A container's border is frameStyle instead. The fluent builders (.fg, .bold, .styled(...)) edit the same style rather than replacing it.

Attributes

Inherited from:
Element
def style: Style

Attributes

Inherited from:
Element