feat(notification): Animate (blink) clock entering done mode (#65)

Optional.
This commit is contained in:
Jens Krause
2025-02-05 19:29:56 +01:00
committed by GitHub
parent 886deb3311
commit e95ecb9e9c
13 changed files with 130 additions and 24 deletions

View File

@@ -151,6 +151,7 @@ impl TuiEventHandler for CountdownState {
if !self.clock.is_done() {
self.clock.tick();
} else {
self.clock.update_done_count();
self.elapsed_clock.tick();
if self.elapsed_clock.is_initial() {
self.elapsed_clock.run();
@@ -278,6 +279,7 @@ impl TuiEventHandler for CountdownState {
pub struct Countdown {
pub style: Style,
pub blink: bool,
}
fn human_days_diff(a: &OffsetDateTime, b: &OffsetDateTime) -> String {
@@ -337,7 +339,7 @@ impl StatefulWidget for Countdown {
}
.to_uppercase(),
);
let widget = ClockWidget::new(self.style);
let widget = ClockWidget::new(self.style, self.blink);
let area = center(
area,
Constraint::Length(max(