mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-19 09:53:08 +02:00
CmdCalendar: Only display relevant parts of the legend
This commit is contained in:
parent
d4c6b0d2d9
commit
44220287c4
1 changed files with 18 additions and 10 deletions
|
@ -293,23 +293,31 @@ int CmdCalendar::execute (std::string& output)
|
||||||
Color color_weeknumber (config.get ("color.calendar.weeknumber"));
|
Color color_weeknumber (config.get ("color.calendar.weeknumber"));
|
||||||
|
|
||||||
if (Context::getContext ().color () && config.getBoolean ("calendar.legend"))
|
if (Context::getContext ().color () && config.getBoolean ("calendar.legend"))
|
||||||
|
{
|
||||||
out << "Legend: "
|
out << "Legend: "
|
||||||
<< color_today.colorize ("today")
|
<< color_today.colorize ("today")
|
||||||
<< ", "
|
<< ", "
|
||||||
<< color_due.colorize ("due")
|
|
||||||
<< ", "
|
|
||||||
<< color_duetoday.colorize ("due-today")
|
|
||||||
<< ", "
|
|
||||||
<< color_overdue.colorize ("overdue")
|
|
||||||
<< ", "
|
|
||||||
<< color_weekend.colorize ("weekend")
|
<< color_weekend.colorize ("weekend")
|
||||||
<< ", "
|
<< ", ";
|
||||||
<< color_holiday.colorize ("holiday")
|
|
||||||
<< ", "
|
// If colorizing due dates, print legend
|
||||||
<< color_weeknumber.colorize ("weeknumber")
|
if (config.get ("calendar.details") != "none")
|
||||||
|
out << color_due.colorize ("due")
|
||||||
|
<< ", "
|
||||||
|
<< color_duetoday.colorize ("due-today")
|
||||||
|
<< ", "
|
||||||
|
<< color_overdue.colorize ("overdue")
|
||||||
|
<< ", ";
|
||||||
|
|
||||||
|
// If colorizing holidays, print legend
|
||||||
|
if (config.get ("calendar.holidays") != "none")
|
||||||
|
out << color_holiday.colorize ("holiday") << ", ";
|
||||||
|
|
||||||
|
out << color_weeknumber.colorize ("weeknumber")
|
||||||
<< '.'
|
<< '.'
|
||||||
<< optionalBlankLine ()
|
<< optionalBlankLine ()
|
||||||
<< '\n';
|
<< '\n';
|
||||||
|
}
|
||||||
|
|
||||||
if (config.get ("calendar.details") == "full" || config.get ("calendar.holidays") == "full")
|
if (config.get ("calendar.details") == "full" || config.get ("calendar.holidays") == "full")
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue