mirror of
https://github.com/kdheepak/taskwarrior-tui.git
synced 2025-08-25 17:57:19 +02:00
Fix priority color
This commit is contained in:
parent
b0faf774fd
commit
ad9d31fcf7
2 changed files with 10 additions and 2 deletions
11
src/app.rs
11
src/app.rs
|
@ -566,6 +566,15 @@ impl TTApp {
|
|||
let mut style = Style::default();
|
||||
|
||||
for tag_name in virtual_tag_names_in_precedence.iter().rev() {
|
||||
if tag_name == "uda." {
|
||||
if let Some(p) = task.priority() {
|
||||
let c = self.config.color.get(&format!("color.{}priority.{}", tag_name, p)).cloned().unwrap_or_default();
|
||||
style = style.fg(c.fg).bg(c.bg);
|
||||
for modifier in c.modifiers {
|
||||
style = style.add_modifier(modifier);
|
||||
}
|
||||
}
|
||||
}
|
||||
if task
|
||||
.tags()
|
||||
.unwrap_or(&vec![])
|
||||
|
@ -1691,7 +1700,7 @@ mod tests {
|
|||
let app = TTApp::new();
|
||||
match app {
|
||||
Ok(app) => {
|
||||
if let Some(task) = app.task_by_id(27) {
|
||||
if let Some(task) = app.task_by_id(1) {
|
||||
let style = app.style_for_task(&task);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -313,7 +313,6 @@ impl Config {
|
|||
fn get_rule_precedence_color() -> Vec<String> {
|
||||
let data = Self::get_config("rule.precedence.color");
|
||||
data.split(',')
|
||||
.filter(|s| !s.ends_with('.'))
|
||||
.map(|s| s.to_string())
|
||||
.collect::<Vec<_>>()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue