Summary Report
- Made the summary bar colors configurable.
This commit is contained in:
@@ -4,6 +4,8 @@
|
|||||||
1.9.1 ()
|
1.9.1 ()
|
||||||
+ Fixed bug #382 in which the annotate command didn't return an error
|
+ Fixed bug #382 in which the annotate command didn't return an error
|
||||||
message when called without an ID.
|
message when called without an ID.
|
||||||
|
+ Summary report bar colors can now be specified with color.summary.bar
|
||||||
|
and color.summary.background configuration variables.
|
||||||
|
|
||||||
------ old releases ------------------------------
|
------ old releases ------------------------------
|
||||||
|
|
||||||
|
|||||||
@@ -506,6 +506,15 @@ Colors any of the messages printed prior to the report output.
|
|||||||
.B color.footnote=green
|
.B color.footnote=green
|
||||||
Colors any of the messages printed last.
|
Colors any of the messages printed last.
|
||||||
|
|
||||||
|
.TP
|
||||||
|
.B color.summary.bar=on green
|
||||||
|
Colors the summary progress bar. Should include both a foreground and a
|
||||||
|
background color.
|
||||||
|
|
||||||
|
.TP
|
||||||
|
.B color.summary.background=on black
|
||||||
|
Colors the summary progress bar. Should include at least a background color.
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
.B color.calendar.today=black on cyan
|
.B color.calendar.today=black on cyan
|
||||||
Color of today in calendar.
|
Color of today in calendar.
|
||||||
|
|||||||
@@ -95,6 +95,8 @@ std::string Config::defaults =
|
|||||||
"color=on # Enable color\n"
|
"color=on # Enable color\n"
|
||||||
"#color.header=bold green # Color of header messages\n"
|
"#color.header=bold green # Color of header messages\n"
|
||||||
"#color.footnote=bold green # Color of footnote messages\n"
|
"#color.footnote=bold green # Color of footnote messages\n"
|
||||||
|
"color.summary.bar=on green # Color of summary report progress bar\n"
|
||||||
|
"color.summary.background=on black # Color of summary report background\n"
|
||||||
"color.calendar.today=black on cyan # Color of today in calendar\n"
|
"color.calendar.today=black on cyan # Color of today in calendar\n"
|
||||||
"color.calendar.due=black on green # Color of days with due tasks in calendar\n"
|
"color.calendar.due=black on green # Color of days with due tasks in calendar\n"
|
||||||
"color.calendar.due.today=black on magenta # Color of today with due tasks in calendar\n"
|
"color.calendar.due.today=black on magenta # Color of today with due tasks in calendar\n"
|
||||||
|
|||||||
@@ -655,6 +655,9 @@ int handleReportSummary (std::string &outs)
|
|||||||
table.sortOn (0, Table::ascendingCharacter);
|
table.sortOn (0, Table::ascendingCharacter);
|
||||||
table.setDateFormat (context.config.get ("dateformat"));
|
table.setDateFormat (context.config.get ("dateformat"));
|
||||||
|
|
||||||
|
Color bar_color (context.config.get ("color.summary.bar"));
|
||||||
|
Color bg_color (context.config.get ("color.summary.background"));
|
||||||
|
|
||||||
int barWidth = 30;
|
int barWidth = 30;
|
||||||
foreach (i, allProjects)
|
foreach (i, allProjects)
|
||||||
{
|
{
|
||||||
@@ -675,17 +678,19 @@ int handleReportSummary (std::string &outs)
|
|||||||
int completedBar = (c * barWidth) / (c + p);
|
int completedBar = (c * barWidth) / (c + p);
|
||||||
|
|
||||||
std::string bar;
|
std::string bar;
|
||||||
|
std::string subbar;
|
||||||
if (context.config.getBoolean ("color") || context.config.getBoolean ("_forcecolor"))
|
if (context.config.getBoolean ("color") || context.config.getBoolean ("_forcecolor"))
|
||||||
{
|
{
|
||||||
bar = "\033[42m";
|
|
||||||
for (int b = 0; b < completedBar; ++b)
|
for (int b = 0; b < completedBar; ++b)
|
||||||
bar += " ";
|
subbar += " ";
|
||||||
|
|
||||||
|
bar += bar_color.colorize (subbar);
|
||||||
|
subbar = "";
|
||||||
|
|
||||||
bar += "\033[40m";
|
|
||||||
for (int b = 0; b < barWidth - completedBar; ++b)
|
for (int b = 0; b < barWidth - completedBar; ++b)
|
||||||
bar += " ";
|
subbar += " ";
|
||||||
|
|
||||||
bar += "\033[0m";
|
bar += bg_color.colorize (subbar);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user