mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-29 17:07:19 +02:00
Feature #340
- Added feature #340, which implements new color rules 'color.completed' and 'color.deleted'.
This commit is contained in:
parent
7986227ea2
commit
10b97fc967
6 changed files with 33 additions and 2 deletions
|
@ -253,6 +253,20 @@ static void colorizeRecurring (Task& task, const std::string& rule, Color& c)
|
|||
c.blend (gsColor[rule]);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
static void colorizeCompleted (Task& task, const std::string& rule, Color& c)
|
||||
{
|
||||
if (task.getStatus () == Task::completed)
|
||||
c.blend (gsColor[rule]);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
static void colorizeDeleted (Task& task, const std::string& rule, Color& c)
|
||||
{
|
||||
if (task.getStatus () == Task::completed)
|
||||
c.blend (gsColor[rule]);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void autoColorize (Task& task, Color& c)
|
||||
{
|
||||
|
@ -283,6 +297,8 @@ void autoColorize (Task& task, Color& c)
|
|||
else if (*r == "color.due.today") colorizeDueToday (task, *r, c);
|
||||
else if (*r == "color.overdue") colorizeOverdue (task, *r, c);
|
||||
else if (*r == "color.recurring") colorizeRecurring (task, *r, c);
|
||||
else if (*r == "color.completed") colorizeCompleted (task, *r, c);
|
||||
else if (*r == "color.deleted") colorizeDeleted (task, *r, c);
|
||||
|
||||
// Wildcards
|
||||
else if (r->substr (0, 9) == "color.tag") colorizeTag (task, *r, c);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue