class

Cresium::TimerView

Inherits Cresium::StackLayout < Reference < Object

Composite widget for the timer screen: a scrollable stack of DigitDisplays (one per timer, the active one centered), a history label above it (while editing), and a status line below.

Constructors

new(show_message : Bool)

Creates the widgets, unattached to a Screen until build is called.

Source

Instance methods

build

Wires the initial widgets into screen; called once from App#compose.

Source
layout(rect : Tui::Rect, timers : Array(Timer), active_index : Int32, history_size : Int32) : Nil

Positions the display stack, history label, and status line within rect.

Source
refresh(rect : Tui::Rect, timers : Array(Timer), active : Timer, editing : Bool, buffer : String, cursor_pos : Int32, cursor_active : Bool, target_time_mode : Bool, target_time_buffer : String, target_time_cursor_pos : Int32, target_time_cursor_active : Bool, history : Array(Time::Span), show_millis_flag : Bool) : Nil

Updates the displayed text/styles/history/scroll arrows from the current state; called every frame by TimerController#tick. buffer/ target_time_buffer are the raw hh:mm[:ss] digit strings being typed; cursor_pos/target_time_cursor_pos and cursor_active/ target_time_cursor_active drive the blinking input cursor.

Source
screen
Source
status
Source
update_status(editing : Bool, target_time_mode : Bool, expired : Bool) : Nil
Source
visible=(value : Bool) : Nil

Shows or hides the whole screen (used when switching to/from the stopwatch screen, or hiding both when the terminal is too small).

Source