diff options
author | Akshay <[email protected]> | 2020-07-10 17:21:52 +0100 |
---|---|---|
committer | Akshay <[email protected]> | 2020-07-10 17:21:52 +0100 |
commit | 3895dd5b875fc4c468d692ee59ec58128365e422 (patch) | |
tree | dd6646c72371675acca4a2b3a334a5eac5e9d55e | |
parent | 188827f3548ea8ca1ab84735b8fe19f99c790207 (diff) |
move config management to utils.rs
-rw-r--r-- | src/utils.rs | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/utils.rs b/src/utils.rs new file mode 100644 index 0000000..55900b0 --- /dev/null +++ b/src/utils.rs | |||
@@ -0,0 +1,32 @@ | |||
1 | use cursive::theme::{BaseColor, Color}; | ||
2 | |||
3 | pub struct AppConfig { | ||
4 | pub true_chr: char, | ||
5 | pub false_chr: char, | ||
6 | pub future_chr: char, | ||
7 | |||
8 | // view dimensions | ||
9 | pub view_width: usize, | ||
10 | pub view_height: usize, | ||
11 | |||
12 | // app dimensions | ||
13 | pub grid_width: usize, | ||
14 | |||
15 | pub reached_color: Color, | ||
16 | pub todo_color: Color, | ||
17 | pub future_color: Color, | ||
18 | } | ||
19 | |||
20 | pub fn load_configuration_file() -> AppConfig { | ||
21 | return AppConfig { | ||
22 | true_chr: '·', | ||
23 | false_chr: '·', | ||
24 | future_chr: '·', | ||
25 | view_width: 25, | ||
26 | view_height: 8, | ||
27 | grid_width: 3, | ||
28 | reached_color: Color::Dark(BaseColor::Cyan), | ||
29 | todo_color: Color::Dark(BaseColor::Magenta), | ||
30 | future_color: Color::Light(BaseColor::Black), | ||
31 | }; | ||
32 | } | ||