CmdChart: In compact mode, render available time labels internally

This commit is contained in:
Paul Beckingham 2016-05-21 21:09:54 -05:00
parent a257ccacc8
commit d27c82b4d3

View file

@ -375,6 +375,7 @@ static void renderExclusionBlocks (
auto spacing = rules.getInteger ("reports." + type + ".spacing");
auto style = rules.get ("reports." + type + ".style");
Color colorExc (palette.enabled ? rules.get ("theme.colors.exclusion") : "");
Color colorLabel (palette.enabled ? rules.get ("theme.colors.label") : "");
// Render the exclusion blocks.
for (int hour = first_hour; hour <= last_hour; hour++)
@ -383,6 +384,13 @@ static void renderExclusionBlocks (
Range r (Datetime (day.year (), day.month (), day.day (), hour, 0, 0),
Datetime (day.year (), day.month (), day.day (), hour + 1, 0, 0));
if (style == "compact")
{
auto label = format ("{1}", hour);
int offset = (hour - first_hour) * (4 + spacing);
lines[0].add (label, offset, colorLabel);
}
for (auto& exc : excluded)
{
if (exc.overlap (r))