Persist app state (#21)

This commit is contained in:
Jens K.
2024-12-22 18:56:55 +01:00
committed by GitHub
parent 2cf411e2ae
commit c9b444e91a
12 changed files with 336 additions and 112 deletions

View File

@@ -8,10 +8,9 @@ use ratatui::{
use std::cmp::max;
use crate::{
args::ClockStyle,
events::{Event, EventHandler},
utils::center,
widgets::clock::{self, Clock, ClockWidget},
widgets::clock::{self, Clock, ClockWidget, Style},
};
#[derive(Debug, Clone)]
@@ -24,13 +23,17 @@ impl Countdown {
Self { clock }
}
pub fn set_style(&mut self, style: ClockStyle) {
pub fn set_style(&mut self, style: Style) {
self.clock.style = style;
}
pub fn set_with_decis(&mut self, with_decis: bool) {
self.clock.with_decis = with_decis;
}
pub fn get_clock(&self) -> &Clock<clock::Countdown> {
&self.clock
}
}
impl EventHandler for Countdown {