class

Term2::Components::Progress

Inherits Term2::Model < Reference < Object

Constants

FPS = 60.0

Animation constants

Constructors

new(opts : Array(Option) = [] of Option, width : Int32 = 30, show_percentage : Bool = true)
Source

Class methods

with_default_gradient
Source
with_gradient(color_a : String, color_b : String) : Option
Source
with_scaled_gradient(color_a : String, color_b : String) : Option
Source
with_solid_fill(color : String) : Option
Source
with_width(w : Int32) : Option
Source
without_percentage
Source

Instance methods

decr_percent(v : Float64) : Cmd
Source
empty_char
Source
empty_char=(empty_char : Char)
Source
empty_color
Source
empty_color=(empty_color : String)
Source
frame

Public command to schedule the next animation frame (Go: nextFrame()).

Source
full_char
Source
full_char=(full_char : Char)
Source
full_color

Styles

Source
full_color=(full_color : String)

Styles

Source
incr_percent(v : Float64) : Cmd
Source
increment_cmd(delta : Float64) : Cmd
Source
init

Init is the first function that will be called. It returns an optional initial command. To not perform an initial command return nil.

Source
percent

Animation state percent is the target percent (Go: targetPercent).

Source
percent=(value : Float64)

Animation state percent is the target percent (Go: targetPercent).

Source
percent_cmd(value : Float64) : Cmd
Source
percent_format
Source
percent_format=(percent_format : String)
Source
percent_shown

Percent currently being rendered (Go: percentShown).

Source
percent_shown=(percent_shown : Float64)

Percent currently being rendered (Go: percentShown).

Source
percentage_style
Source
percentage_style=(percentage_style : Style)
Source
ramp_color_a
Source
ramp_color_a=(ramp_color_a : Color)
Source
ramp_color_b
Source
ramp_color_b=(ramp_color_b : Color)
Source
scale_ramp=(scale_ramp : Bool)
Source
scale_ramp?
Source
set_percent(p : Float64) : Cmd
Source
show_percentage=(show_percentage : Bool)
Source
show_percentage?
Source
target_percent
Source
target_percent=(target_percent : Float64)
Source
update(msg : Msg) : Tuple(Progress, Cmd)

Update is called when a message is received. Use it to inspect the message and, in response, update the model and/or send a command.

Source
use_gradient=(v : Bool) : Bool
Source
use_gradient?

Compatibility alias used by some example ports.

Source
use_ramp=(use_ramp : Bool)

Gradient settings

Source
use_ramp?

Gradient settings

Source
velocity
Source
velocity=(velocity : Float64)
Source
view

View renders the program's UI, which is just a string. The view is rendered after every Update.

Source
view_as(percent : Float64) : String
Source
width

--- Properties ---

Source
width=(width : Int32)

--- Properties ---

Source

Nested types