From 5cecc3d772d158f8a43d6794b1edda60fe2682bd Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Fri, 23 Jul 2010 22:31:38 -0700 Subject: [PATCH] Enhancement - color.alternate - The 'stats' and 'info' reports now obey color.alternate. --- ChangeLog | 1 + src/report.cpp | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/ChangeLog b/ChangeLog index 09a6abdcb..fb86d9ae4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -17,6 +17,7 @@ on default values. + Special tags 'nocal', 'nocolor' and 'nonag' are implemented. + The 'tags' command highlights special tags. + + The 'stats' and 'info' reports not obey color.alternate. + Fixed bug #427, preventing the task edit command to parse annotation dates with spaces. + Fixed bug #433, making task command output more consistent. diff --git a/src/report.cpp b/src/report.cpp index ce83acec7..569cc7332 100644 --- a/src/report.cpp +++ b/src/report.cpp @@ -609,6 +609,14 @@ int handleInfo (std::string &outs) table.addCell (row, 1, color); } + // If an alternating row color is specified, notify the table. + if (context.config.getBoolean ("color") || context.config.getBoolean ("_forcecolor")) + { + Color alternate (context.config.get ("color.alternate")); + if (alternate.nontrivial ()) + table.setTableAlternateColor (alternate); + } + out << optionalBlankLine () << table.render () << std::endl; @@ -2506,6 +2514,14 @@ int handleReportStats (std::string &outs) table.addCell (row, 1, value.str ()); } + // If an alternating row color is specified, notify the table. + if (context.config.getBoolean ("color") || context.config.getBoolean ("_forcecolor")) + { + Color alternate (context.config.get ("color.alternate")); + if (alternate.nontrivial ()) + table.setTableAlternateColor (alternate); + } + out << optionalBlankLine () << table.render () << optionalBlankLine ();