diff --git a/ChangeLog b/ChangeLog index b25b789ba..4dc041060 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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 ------------------------------ diff --git a/html/config.html b/html/config.html index fd4bc71a4..20b211fcf 100644 --- a/html/config.html +++ b/html/config.html @@ -218,7 +218,8 @@ color.pri.L
color.pri.none
color.active
- color.tagged + color.tagged
+ color.recurring
These are the coloration rules. They correspond to a particular diff --git a/html/task.html b/html/task.html index 6634516dd..04bc81f96 100644 --- a/html/task.html +++ b/html/task.html @@ -125,6 +125,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.

    diff --git a/src/Config.cpp b/src/Config.cpp index 64e07b04c..643c0ac16 100644 --- a/src/Config.cpp +++ b/src/Config.cpp @@ -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"); diff --git a/src/rules.cpp b/src/rules.cpp index f33354c9f..cac04156e 100644 --- a/src/rules.cpp +++ b/src/rules.cpp @@ -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 ::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"]; + } + } } ////////////////////////////////////////////////////////////////////////////////