From 3895dd5b875fc4c468d692ee59ec58128365e422 Mon Sep 17 00:00:00 2001 From: Akshay Date: Fri, 10 Jul 2020 21:51:52 +0530 Subject: move config management to utils.rs --- src/utils.rs | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/utils.rs 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 @@ +use cursive::theme::{BaseColor, Color}; + +pub struct AppConfig { + pub true_chr: char, + pub false_chr: char, + pub future_chr: char, + + // view dimensions + pub view_width: usize, + pub view_height: usize, + + // app dimensions + pub grid_width: usize, + + pub reached_color: Color, + pub todo_color: Color, + pub future_color: Color, +} + +pub fn load_configuration_file() -> AppConfig { + return AppConfig { + true_chr: '·', + false_chr: '·', + future_chr: '·', + view_width: 25, + view_height: 8, + grid_width: 3, + reached_color: Color::Dark(BaseColor::Cyan), + todo_color: Color::Dark(BaseColor::Magenta), + future_color: Color::Light(BaseColor::Black), + }; +} -- cgit v1.2.3