Colorization - color.recurring
- Added support for "color.recurring" configuration variable to colorize recurring tasks. - Updated docs.
This commit is contained in:
@@ -31,6 +31,8 @@
|
||||
+ Fixed bug that concatenated a modified description without spaces.
|
||||
+ Added new column 'recur' that displays the recurrence period of any
|
||||
recurring tasks. This column can be added to any custom report.
|
||||
+ Added support for "color.recurring" configuration variable which
|
||||
specifies the color of recurring tasks.
|
||||
|
||||
------ old releases ------------------------------
|
||||
|
||||
|
||||
@@ -218,7 +218,8 @@
|
||||
color.pri.L<br />
|
||||
color.pri.none<br />
|
||||
color.active<br />
|
||||
color.tagged
|
||||
color.tagged<br />
|
||||
color.recurring
|
||||
</dt>
|
||||
<dd>
|
||||
These are the coloration rules. They correspond to a particular
|
||||
|
||||
@@ -125,6 +125,8 @@
|
||||
<li>Fixed bug that concatenated a modified description without spaces.
|
||||
<li>Added new column 'recur' that displays the recurrence period of any
|
||||
recurring tasks. This column can be added to any custom report.
|
||||
<li>Added support for "color.recurring" configuration variable which
|
||||
specifies the color of recurring tasks.
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
|
||||
@@ -144,6 +144,7 @@ void Config::createDefault (const std::string& home)
|
||||
fprintf (out, "#color.tag.bug=yellow\n");
|
||||
fprintf (out, "#color.project.garden=on_green\n");
|
||||
fprintf (out, "#color.keyword.car=on_blue\n");
|
||||
fprintf (out, "#color.recurring=on_red\n");
|
||||
fprintf (out, "#shadow.file=%s/shadow.txt\n", dataDir.c_str ());
|
||||
fprintf (out, "#shadow.command=list\n");
|
||||
fprintf (out, "#shadow.notify=on\n");
|
||||
|
||||
@@ -89,6 +89,17 @@ void autoColorize (
|
||||
// Note: fg, bg already contain colors specifically assigned via command.
|
||||
// Note: These rules form a hierarchy - the last rule is king.
|
||||
|
||||
// Colorization of the recurring.
|
||||
if (gsFg["color.recurring"] != Text::nocolor ||
|
||||
gsBg["color.recurring"] != Text::nocolor)
|
||||
{
|
||||
if (task.getAttribute ("recur") != "")
|
||||
{
|
||||
fg = gsFg["color.recurring"];
|
||||
bg = gsBg["color.recurring"];
|
||||
}
|
||||
}
|
||||
|
||||
// Colorization of the tagged.
|
||||
if (gsFg["color.tagged"] != Text::nocolor ||
|
||||
gsBg["color.tagged"] != Text::nocolor)
|
||||
@@ -157,29 +168,6 @@ void autoColorize (
|
||||
}
|
||||
}
|
||||
|
||||
// Colorization of the due and overdue.
|
||||
std::string due = task.getAttribute ("due");
|
||||
if (due != "")
|
||||
{
|
||||
Date dueDate (::atoi (due.c_str ()));
|
||||
Date now;
|
||||
Date then (now + conf.get ("due", 7) * 86400);
|
||||
|
||||
// Overdue
|
||||
if (dueDate < now)
|
||||
{
|
||||
fg = gsFg["color.overdue"];
|
||||
bg = gsBg["color.overdue"];
|
||||
}
|
||||
|
||||
// Imminent
|
||||
else if (dueDate < then)
|
||||
{
|
||||
fg = gsFg["color.due"];
|
||||
bg = gsBg["color.due"];
|
||||
}
|
||||
}
|
||||
|
||||
// Colorization by tag value.
|
||||
std::map <std::string, Text::color>::iterator it;
|
||||
for (it = gsFg.begin (); it != gsFg.end (); ++it)
|
||||
@@ -223,6 +211,29 @@ void autoColorize (
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Colorization of the due and overdue.
|
||||
std::string due = task.getAttribute ("due");
|
||||
if (due != "")
|
||||
{
|
||||
Date dueDate (::atoi (due.c_str ()));
|
||||
Date now;
|
||||
Date then (now + conf.get ("due", 7) * 86400);
|
||||
|
||||
// Overdue
|
||||
if (dueDate < now)
|
||||
{
|
||||
fg = gsFg["color.overdue"];
|
||||
bg = gsBg["color.overdue"];
|
||||
}
|
||||
|
||||
// Imminent
|
||||
else if (dueDate < then)
|
||||
{
|
||||
fg = gsFg["color.due"];
|
||||
bg = gsBg["color.due"];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Reference in New Issue
Block a user