diff options
| author | Saiyed Shizain <saiyedshizain@gmail.com> | 2026-01-18 21:41:13 +0530 |
|---|---|---|
| committer | Saiyed Shizain <saiyedshizain@gmail.com> | 2026-01-18 21:41:13 +0530 |
| commit | 4e22d4150020fa1068dcd3867d026215d5156271 (patch) | |
| tree | a60321b5c5f64267814f260e0ac93c957b9ae0e9 /src/pomo/state.rs | |
| parent | f885b4a05ddc047085f153bed87bb8048ca35536 (diff) | |
| download | pomoru-4e22d4150020fa1068dcd3867d026215d5156271.tar.xz pomoru-4e22d4150020fa1068dcd3867d026215d5156271.zip | |
update ui timer, update mod and state to fix unused warnings
Diffstat (limited to 'src/pomo/state.rs')
| -rw-r--r-- | src/pomo/state.rs | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/pomo/state.rs b/src/pomo/state.rs index 111e935..c7a3011 100644 --- a/src/pomo/state.rs +++ b/src/pomo/state.rs @@ -1,4 +1,5 @@ use ratatui::widgets::ListState; +use ratatui::prelude::Color; use std::time::Duration; #[derive(PartialEq, Clone, Copy)] @@ -8,6 +9,16 @@ pub enum SessionMode { LongBreak, } +impl SessionMode { + pub fn get_color(&self) -> Color { + match self { + SessionMode::Work => Color::Cyan, + SessionMode::ShortBreak => Color::Green, + SessionMode::LongBreak => Color::Magenta, + } + } +} + pub struct Task { pub title: String, pub is_done: bool, @@ -24,11 +35,16 @@ pub struct Pomo { impl Pomo { pub fn new() -> Self { + let dummy_tasks = vec![ + Task { title: "Complete Milestone 1".into(), is_done: true }, + Task { title: "Refactor UI for Flocus look".into(), is_done: false }, + ]; + Self { mode: SessionMode::Work, time_remaining: Duration::from_secs(25 * 60), is_running: false, - tasks: Vec::new(), + tasks: dummy_tasks, task_state: ListState::default(), should_quit: false, } @@ -39,7 +55,7 @@ impl Pomo { self.time_remaining -= Duration::from_secs(1); } else if self.time_remaining.as_secs() == 0 { self.is_running = false; - // logic for switching modes will go here + // TODO: Add further mode switching logic } } |