class

Cresium::StopwatchController

Inherits Cresium::Dispatchable < Reference < Object

Owns the stopwatch screen's state (the list of stopwatches, which one is active) and its keyboard handlers, and drives its StopwatchView.

Constructors

new(show_message : Bool)

Starts with a single fresh stopwatch, active and selected.

Source

Instance methods

active

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

Source
handle_key(event : Tui::KeyEvent) : Bool

Entry point for keyboard input on this screen; routes to whichever @[OnKeyPress(..., :stopwatch)] handler matches event.

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

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

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

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

Source
view
Source