pub struct TimerProps {Show 15 fields
pub duration: Duration,
pub mode: TimerMode,
pub format: TimeFormat,
pub color: Option<Color>,
pub warn_color: Option<Color>,
pub danger_color: Option<Color>,
pub complete_color: Option<Color>,
pub warn_threshold: Option<Duration>,
pub danger_threshold: Option<Duration>,
pub blink_on_danger: bool,
pub blink_visible: bool,
pub prefix: Option<String>,
pub suffix: Option<String>,
pub bold: bool,
pub dim: bool,
}Expand description
Properties for the Timer component.
Fields§
§duration: DurationCurrent duration to display.
mode: TimerModeTimer mode (stopwatch or countdown).
format: TimeFormatDisplay format.
color: Option<Color>Default color.
warn_color: Option<Color>Color when warn threshold is reached (countdown only).
danger_color: Option<Color>Color when danger threshold is reached (countdown only).
complete_color: Option<Color>Color when completed (countdown reached zero).
warn_threshold: Option<Duration>Warn threshold (countdown only).
danger_threshold: Option<Duration>Danger threshold (countdown only).
blink_on_danger: boolWhether to show blinking when in danger zone.
blink_visible: boolCurrent blink state (for external control).
prefix: Option<String>Optional prefix text.
suffix: Option<String>Optional suffix text.
bold: boolBold text.
dim: boolDim text.
Implementations§
Source§impl TimerProps
impl TimerProps
Sourcepub fn format(self, format: TimeFormat) -> Self
pub fn format(self, format: TimeFormat) -> Self
Set the display format.
Sourcepub fn warn_at(self, threshold: Duration) -> Self
pub fn warn_at(self, threshold: Duration) -> Self
Set the warn threshold and color (countdown only).
Sourcepub fn danger_at(self, threshold: Duration) -> Self
pub fn danger_at(self, threshold: Duration) -> Self
Set the danger threshold and color (countdown only).
Sourcepub fn warn_color(self, color: Color) -> Self
pub fn warn_color(self, color: Color) -> Self
Set the warn color.
Sourcepub fn danger_color(self, color: Color) -> Self
pub fn danger_color(self, color: Color) -> Self
Set the danger color.
Sourcepub fn complete_color(self, color: Color) -> Self
pub fn complete_color(self, color: Color) -> Self
Set the complete color.
Sourcepub fn blink_on_danger(self, blink: bool) -> Self
pub fn blink_on_danger(self, blink: bool) -> Self
Enable blinking when in danger zone.
Sourcepub fn blink_visible(self, visible: bool) -> Self
pub fn blink_visible(self, visible: bool) -> Self
Set current blink visibility state.
Sourcepub fn is_complete(&self) -> bool
pub fn is_complete(&self) -> bool
Check if countdown is complete.
Trait Implementations§
Source§impl Clone for TimerProps
impl Clone for TimerProps
Source§fn clone(&self) -> TimerProps
fn clone(&self) -> TimerProps
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more