diff --git a/docs/configuration/advanced.md b/docs/configuration/advanced.md index 39281939..6e494b1b 100644 --- a/docs/configuration/advanced.md +++ b/docs/configuration/advanced.md @@ -18,6 +18,7 @@ uda.taskwarrior-tui.selection.italic=no uda.taskwarrior-tui.selection.dim=no uda.taskwarrior-tui.selection.blink=no uda.taskwarrior-tui.selection.reverse=no +uda.taskwarrior-tui.unselected.dim=no uda.taskwarrior-tui.mark.indicator=✔ uda.taskwarrior-tui.unmark.indicator= uda.taskwarrior-tui.mark-selection.indicator=⦿ diff --git a/src/app.rs b/src/app.rs index 948a2d94..c6f45891 100644 --- a/src/app.rs +++ b/src/app.rs @@ -1112,6 +1112,10 @@ impl TaskwarriorTui { let virtual_tag_names_in_precedence = &self.config.rule_precedence_color; let mut style = Style::default(); + if self.config.uda_unselected_dim { + style = style.patch(self.config.uda_style_report_unselected); + style = style.add_modifier(Modifier::DIM); + } for tag_name in virtual_tag_names_in_precedence.iter().rev() { if tag_name == "uda." || tag_name == "priority" { @@ -1227,6 +1231,9 @@ impl TaskwarriorTui { if self.config.uda_selection_reverse { highlight_style = highlight_style.add_modifier(Modifier::REVERSED); } + if self.config.uda_unselected_dim { + highlight_style = highlight_style.fg(Color::White); + } } rows.push(Row::StyledData(task.iter(), style)); } diff --git a/src/config.rs b/src/config.rs index da608ce0..d7c4b743 100644 --- a/src/config.rs +++ b/src/config.rs @@ -80,9 +80,11 @@ pub struct Config { pub uda_selection_dim: bool, pub uda_selection_blink: bool, pub uda_selection_reverse: bool, + pub uda_unselected_dim: bool, pub uda_calendar_months_per_row: usize, pub uda_style_context_active: Style, pub uda_style_report_selection: Style, + pub uda_style_report_unselected: Style, pub uda_style_calendar_title: Style, pub uda_style_calendar_today: Style, pub uda_style_navbar: Style, @@ -146,8 +148,10 @@ impl Config { let uda_selection_dim = Self::get_uda_selection_dim(data); let uda_selection_blink = Self::get_uda_selection_blink(data); let uda_selection_reverse = Self::get_uda_selection_reverse(data); + let uda_unselected_dim = Self::get_uda_unselected_dim(data); let uda_calendar_months_per_row = Self::get_uda_months_per_row(data); let uda_style_report_selection = Self::get_uda_style("report.selection", data); + let uda_style_report_unselected = Self::get_uda_style("report.unselected", data); let uda_style_report_scrollbar = Self::get_uda_style("report.scrollbar", data); let uda_style_report_scrollbar_area = Self::get_uda_style("report.scrollbar.area", data); let uda_style_calendar_title = Self::get_uda_style("calendar.title", data); @@ -161,6 +165,7 @@ impl Config { let uda_background_process = Self::get_uda_background_process(data); let uda_background_process_period = Self::get_uda_background_process_period(data); let uda_style_report_selection = uda_style_report_selection.unwrap_or_default(); + let uda_style_report_unselected = uda_style_report_unselected.unwrap_or_default(); let uda_style_report_scrollbar = uda_style_report_scrollbar.unwrap_or_else(|| Style::default().fg(Color::Black)); let uda_style_report_scrollbar_area = uda_style_report_scrollbar_area.unwrap_or_default(); let uda_style_calendar_title = uda_style_calendar_title.unwrap_or_default(); @@ -213,8 +218,10 @@ impl Config { uda_selection_dim, uda_selection_blink, uda_selection_reverse, + uda_unselected_dim, uda_calendar_months_per_row, uda_style_report_selection, + uda_style_report_unselected, uda_style_context_active, uda_style_calendar_title, uda_style_calendar_today, @@ -712,6 +719,13 @@ impl Config { .unwrap_or(false) } + fn get_uda_unselected_dim(data: &str) -> bool { + Self::get_config("uda.taskwarrior-tui.unselected.dim", data) + .unwrap_or_default() + .get_bool() + .unwrap_or(false) + } + fn get_uda_months_per_row(data: &str) -> usize { Self::get_config("uda.taskwarrior-tui.calendar.months-per-row", data) .unwrap_or_default()