ProgressMeterBuilders

io.worxbend.tui.dsl.ProgressMeterBuilders

The caption and fill-ramp builders shared by the one-row progress meters, GaugeElement and ProgressBarElement.

A view reaches for whichever meter fits and gets the same vocabulary either way: the same caption trio and the same two ramps, so the two are captioned and colored identically whichever one a view reaches for. They were once the same five method bodies written out on both elements — a pair that had already drifted in its wording and would have drifted in its behavior next.

The Self type is F-bounded so every builder answers the element's own type and a mixed chain — progressBar(0.5).bare.preset(...) — keeps the element-specific builders reachable after a shared one. An implementer supplies three hooks: the caption and ramp it currently carries, and a rebuild with both replaced.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Members list

Value members

Abstract methods

protected def progressLabel: ProgressLabel

The caption the meter currently carries.

The caption the meter currently carries.

Attributes

protected def progressRamp: Option[ColorRamp]

The ramp the fill is currently colored by, or None for the flat fill style.

The ramp the fill is currently colored by, or None for the flat fill style.

Attributes

protected def withProgress(label: ProgressLabel, ramp: Option[ColorRamp]): Self

This meter rebuilt with the caption and the fill ramp replaced together.

This meter rebuilt with the caption and the fill ramp replaced together.

Attributes

Concrete methods

def bare: Self

Drops the caption entirely, leaving the bar uninterrupted.

Drops the caption entirely, leaving the bar uninterrupted.

Attributes

def label(text: String): Self

Replaces the percentage caption with fixed text.

Replaces the percentage caption with fixed text.

Attributes

def labelled(text: String): Self

Shows fixed text followed by the percentage, as in syncing 42%.

Shows fixed text followed by the percentage, as in syncing 42%.

Attributes

def ramp(chosen: ColorRamp): Self

Colors the fill by how far along it is — see io.worxbend.tui.widgets.ColorRamp for the built-in ramps. ColorRamp.Traffic walks green through amber to red, which is what an "how bad is it" meter (disk usage, an air-quality index) wants and a download bar does not.

Colors the fill by how far along it is — see io.worxbend.tui.widgets.ColorRamp for the built-in ramps. ColorRamp.Traffic walks green through amber to red, which is what an "how bad is it" meter (disk usage, an air-quality index) wants and a download bar does not.

Attributes

def ramp(from: Color, to: Color): Self

A two-color ramp built inline, for the many cases with no named preset.

A two-color ramp built inline, for the many cases with no named preset.

Attributes