(pomodoro) count WORK rounds (#75)

This commit is contained in:
Jens Krause
2025-04-29 16:20:02 +02:00
committed by GitHub
parent 028a067419
commit 90d9988e7a
6 changed files with 46 additions and 14 deletions

View File

@@ -61,6 +61,7 @@ pub struct AppArgs {
pub app_time_format: AppTimeFormat,
pub content: Content,
pub pomodoro_mode: PomodoroMode,
pub pomodoro_round: u64,
pub initial_value_work: Duration,
pub current_value_work: Duration,
pub initial_value_pause: Duration,
@@ -94,6 +95,7 @@ impl From<FromAppArgs> for App {
content: args.mode.unwrap_or(stg.content),
style: args.style.unwrap_or(stg.style),
pomodoro_mode: stg.pomodoro_mode,
pomodoro_round: stg.pomodoro_count,
initial_value_work: args.work.unwrap_or(stg.inital_value_work),
// invalidate `current_value_work` if an initial value is set via args
current_value_work: args.work.unwrap_or(stg.current_value_work),
@@ -142,6 +144,7 @@ impl App {
content,
with_decis,
pomodoro_mode,
pomodoro_round,
notification,
blink,
sound_path,
@@ -183,6 +186,7 @@ impl App {
initial_value_pause,
current_value_pause,
with_decis,
round: pomodoro_round,
app_tx: app_tx.clone(),
}),
footer: FooterState::new(show_menu, app_time_format),
@@ -359,6 +363,7 @@ impl App {
style: self.style,
with_decis: self.with_decis,
pomodoro_mode: self.pomodoro.get_mode().clone(),
pomodoro_count: self.pomodoro.get_round(),
inital_value_work: Duration::from(*self.pomodoro.get_clock_work().get_initial_value()),
current_value_work: Duration::from(*self.pomodoro.get_clock_work().get_current_value()),
inital_value_pause: Duration::from(