class

Cresium::TimerController

Inherits Cresium::Dispatchable < Reference < Object

Owns the timer screen's state (the list of timers, which one is active, the hh:mm:ss / target-time input buffers) and its keyboard handlers, and drives its TimerView.

Constants

HISTORY_MAX = 3
TARGET_TIME_DIGITS = 4

hh:mm target-time input, toggled with [t] while editing a timer.

TARGET_TIME_LAST_DIGIT = TARGET_TIME_DIGITS - 1
TIMER_DIGITS = 6
TIMER_LAST_DIGIT = TIMER_DIGITS - 1

Constructors

new(show_message : Bool)

Starts with a single fresh (unset) timer, in editing mode.

Source

Instance methods

active

The currently selected timer (shown centered, in full color).

Source
buffer
Source
editing?
Source
handle_key(event : Tui::KeyEvent) : Bool

Entry point for keyboard input on this screen; routes to the :timer_editing handlers while entering a duration, or :timer_running ones once a timer has been set. Refreshes the status line whenever an editing key was actually handled (its hint text depends on the input).

Source
layout(rect : Tui::Rect) : Nil

Positions the view's widgets within rect (called on resize/screen switch).

Source
tick(rect : Tui::Rect, show_millis : Bool) : Nil

Pushes the current state to the view for rendering (called every frame).

Source
timers
Source
view
Source