Persist app state (#21)
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user