mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
CmdReportDay: Added an indicator that the interval is open
This commit is contained in:
parent
0714499fae
commit
f4271614d5
1 changed files with 28 additions and 13 deletions
|
@ -151,22 +151,37 @@ int CmdReportDay (
|
|||
}
|
||||
|
||||
auto width = end_offset - start_offset;
|
||||
|
||||
std::vector <std::string> lines;
|
||||
wrapText (lines, label, width, false);
|
||||
|
||||
std::string label1 (width, ' ');
|
||||
std::string label2 = label1;
|
||||
if (lines.size () > 0)
|
||||
if (width)
|
||||
{
|
||||
label1 = leftJustify (lines[0], width);
|
||||
std::vector <std::string> lines;
|
||||
wrapText (lines, label, width, false);
|
||||
|
||||
if (lines.size () > 1)
|
||||
label2 = leftJustify (lines[1], width);
|
||||
std::string label1 (width, ' ');
|
||||
std::string label2 = label1;
|
||||
if (lines.size () > 0)
|
||||
{
|
||||
label1 = leftJustify (lines[0], width);
|
||||
|
||||
if (lines.size () > 1)
|
||||
label2 = leftJustify (lines[1], width);
|
||||
}
|
||||
|
||||
line1.add (label1, start_offset, colorTrack);
|
||||
line2.add (label2, start_offset, colorTrack);
|
||||
|
||||
// An open interval gets a "..." in the bottom right corner, or
|
||||
// whatever fits.
|
||||
if (! track.range.ended ())
|
||||
{
|
||||
int space = 3;
|
||||
if (width < 3)
|
||||
space = width;
|
||||
|
||||
line2.add (std::string (space, '.'),
|
||||
width - space,
|
||||
colorTrack);
|
||||
}
|
||||
}
|
||||
|
||||
line1.add (label1, start_offset, colorTrack);
|
||||
line2.add (label2, start_offset, colorTrack);
|
||||
}
|
||||
|
||||
std::cout << indent << line1.str () << '\n'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue