aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAkshay <[email protected]>2020-07-10 17:21:52 +0100
committerAkshay <[email protected]>2020-07-10 17:21:52 +0100
commit3895dd5b875fc4c468d692ee59ec58128365e422 (patch)
treedd6646c72371675acca4a2b3a334a5eac5e9d55e /src
parent188827f3548ea8ca1ab84735b8fe19f99c790207 (diff)
move config management to utils.rs
Diffstat (limited to 'src')
-rw-r--r--src/utils.rs32
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 @@
1use cursive::theme::{BaseColor, Color};
2
3pub 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
20pub 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}