Add months_per_row to configuration

This commit is contained in:
Dheepak Krishnamurthy 2020-10-22 15:07:18 -06:00
parent 0f8647382b
commit 6333e500f7
3 changed files with 25 additions and 8 deletions

View file

@ -38,6 +38,7 @@ pub struct TConfig {
pub uda_selection_italic: bool,
pub uda_selection_dim: bool,
pub uda_selection_blink: bool,
pub uda_calendar_months_per_row: usize,
}
impl TConfig {
@ -54,6 +55,7 @@ impl TConfig {
uda_selection_italic: Self::get_uda_selection_italic(),
uda_selection_dim: Self::get_uda_selection_dim(),
uda_selection_blink: Self::get_uda_selection_blink(),
uda_calendar_months_per_row: Self::get_uda_months_per_row(),
}
}
@ -241,7 +243,7 @@ impl TConfig {
return line.trim_start_matches(config).trim_start().trim_end().to_string();
}
}
"".to_string()
"".to_string()
}
fn get_rule_precedence_color() -> Vec<String> {
@ -294,6 +296,14 @@ impl TConfig {
}
}
fn get_uda_months_per_row() -> usize {
let s = Self::get_config("uda.taskwarrior-tui.calendar.months_per_row");
match s.parse::<usize>() {
Ok(i) => i,
Err(e) => 4,
}
}
fn get_uda_selection_blink() -> bool {
let s = Self::get_config("uda.taskwarrior-tui.selection.blink");
if s == "yes" {