feat: bind r to restart current countdown
This commit is contained in:
parent
ce566c20ce
commit
73c103b6e7
|
@ -52,6 +52,7 @@ impl Pomodoro {
|
||||||
self.paused = Default::default();
|
self.paused = Default::default();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
KeyCode::Char('r') | KeyCode::Char('R') => self.restart(),
|
||||||
KeyCode::Char('q') | KeyCode::Char('Q') => break,
|
KeyCode::Char('q') | KeyCode::Char('Q') => break,
|
||||||
KeyCode::Char('c') if key_event.modifiers == KeyModifiers::CONTROL => break,
|
KeyCode::Char('c') if key_event.modifiers == KeyModifiers::CONTROL => break,
|
||||||
_ => {}
|
_ => {}
|
||||||
|
@ -64,6 +65,11 @@ impl Pomodoro {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn restart(&mut self) {
|
||||||
|
self.wait_start = Some(Instant::now());
|
||||||
|
self.paused = Default::default();
|
||||||
|
}
|
||||||
|
|
||||||
fn notify_complete(&self) -> Result<(), Box<dyn Error>> {
|
fn notify_complete(&self) -> Result<(), Box<dyn Error>> {
|
||||||
let mut toast = notify_rust::Notification::new();
|
let mut toast = notify_rust::Notification::new();
|
||||||
toast.summary("Pomodoro cycle complete!");
|
toast.summary("Pomodoro cycle complete!");
|
||||||
|
|
Loading…
Reference in New Issue