mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
Bug: The rc.reports.<type>.totals setting should control 'Totals' label
- Thanks to Matthew Lemon.
This commit is contained in:
parent
b62a977bd5
commit
52c294cc4c
3 changed files with 11 additions and 4 deletions
1
AUTHORS
1
AUTHORS
|
@ -26,3 +26,4 @@ suggestions:
|
||||||
Wade Duvall
|
Wade Duvall
|
||||||
Sebastian Uharek
|
Sebastian Uharek
|
||||||
Aaron Curtis
|
Aaron Curtis
|
||||||
|
Matthew Lemon
|
||||||
|
|
|
@ -6,6 +6,8 @@
|
||||||
(thanks to Gordon Ball).
|
(thanks to Gordon Ball).
|
||||||
- Improved out-of-source build for themes, holidays
|
- Improved out-of-source build for themes, holidays
|
||||||
(thanks to Kent R. Spillner).
|
(thanks to Kent R. Spillner).
|
||||||
|
- The rc.reports.<type>.totals setting should control 'Totals' label
|
||||||
|
(thanks to Matthew Lemon).
|
||||||
|
|
||||||
------ current release ---------------------------
|
------ current release ---------------------------
|
||||||
|
|
||||||
|
|
|
@ -203,8 +203,7 @@ int renderChart (
|
||||||
<< std::string (indent, ' ')
|
<< std::string (indent, ' ')
|
||||||
<< lines[i].str ();
|
<< lines[i].str ();
|
||||||
|
|
||||||
std::cout << " "
|
std::cout << renderTotal (type, rules, work)
|
||||||
<< renderTotal (type, rules, work)
|
|
||||||
<< '\n';
|
<< '\n';
|
||||||
|
|
||||||
previous = day;
|
previous = day;
|
||||||
|
@ -281,6 +280,7 @@ static void renderAxis (
|
||||||
int last_hour)
|
int last_hour)
|
||||||
{
|
{
|
||||||
auto spacing = rules.getInteger ("reports." + type + ".spacing");
|
auto spacing = rules.getInteger ("reports." + type + ".spacing");
|
||||||
|
auto showTotal = rules.getBoolean ("reports." + type + ".totals");
|
||||||
Color colorLabel (palette.enabled ? rules.get ("theme.colors.label") : "");
|
Color colorLabel (palette.enabled ? rules.get ("theme.colors.label") : "");
|
||||||
Color colorToday (palette.enabled ? rules.get ("theme.colors.today") : "");
|
Color colorToday (palette.enabled ? rules.get ("theme.colors.today") : "");
|
||||||
|
|
||||||
|
@ -293,7 +293,10 @@ static void renderAxis (
|
||||||
else
|
else
|
||||||
std::cout << colorLabel.colorize (leftJustify (hour, 4 + spacing));
|
std::cout << colorLabel.colorize (leftJustify (hour, 4 + spacing));
|
||||||
|
|
||||||
std::cout << " " << colorLabel.colorize ("Total") << "\n";
|
if (showTotal)
|
||||||
|
std::cout << " " << colorLabel.colorize ("Total");
|
||||||
|
|
||||||
|
std::cout << '\n';
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -363,7 +366,8 @@ static std::string renderTotal (
|
||||||
{
|
{
|
||||||
int hours = work / 3600;
|
int hours = work / 3600;
|
||||||
int minutes = (work % 3600) / 60;
|
int minutes = (work % 3600) / 60;
|
||||||
std::cout << std::setw (3) << std::setfill (' ') << hours
|
std::cout << " "
|
||||||
|
<< std::setw (3) << std::setfill (' ') << hours
|
||||||
<< ':'
|
<< ':'
|
||||||
<< std::setw (2) << std::setfill ('0') << minutes;
|
<< std::setw (2) << std::setfill ('0') << minutes;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue