diff options
author | Akshay <[email protected]> | 2021-02-24 06:27:37 +0000 |
---|---|---|
committer | Akshay <[email protected]> | 2021-02-24 06:27:37 +0000 |
commit | fbcc966a3da8a75842c6b8843a9fd7f1edb0db15 (patch) | |
tree | be2851277e689fec2f1629ca7a03bba1c8931446 /src/views.rs | |
parent | 3169cb6c8056b46a6f08533014366b8c441971f8 (diff) |
add GoalKinds
- this allows for changing habit goals easily
- easier to add new habits to dijo in newer versions
Diffstat (limited to 'src/views.rs')
-rw-r--r-- | src/views.rs | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/views.rs b/src/views.rs index b90ce2b..ca4f757 100644 --- a/src/views.rs +++ b/src/views.rs | |||
@@ -7,7 +7,7 @@ use cursive::{Printer, Vec2}; | |||
7 | use chrono::prelude::*; | 7 | use chrono::prelude::*; |
8 | use chrono::{Local, NaiveDate}; | 8 | use chrono::{Local, NaiveDate}; |
9 | 9 | ||
10 | use crate::habit::{Bit, Count, Habit, TrackEvent, ViewMode}; | 10 | use crate::habit::{Bit, Count, Float, Habit, TrackEvent, ViewMode}; |
11 | use crate::theme::cursor_bg; | 11 | use crate::theme::cursor_bg; |
12 | use crate::utils::VIEW_WIDTH; | 12 | use crate::utils::VIEW_WIDTH; |
13 | 13 | ||
@@ -193,5 +193,12 @@ macro_rules! auto_view_impl { | |||
193 | }; | 193 | }; |
194 | } | 194 | } |
195 | 195 | ||
196 | auto_view_impl!(Count); | 196 | macro_rules! generate_view_impls { |
197 | auto_view_impl!(Bit); | 197 | ($($x:ident),*) => ( |
198 | $( | ||
199 | auto_view_impl!($x); | ||
200 | )* | ||
201 | ); | ||
202 | } | ||
203 | |||
204 | generate_view_impls!(Count, Bit, Float); | ||