mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
CmdChart: In compact mode, render available time labels internally
This commit is contained in:
parent
a257ccacc8
commit
d27c82b4d3
1 changed files with 8 additions and 0 deletions
|
@ -375,6 +375,7 @@ static void renderExclusionBlocks (
|
||||||
auto spacing = rules.getInteger ("reports." + type + ".spacing");
|
auto spacing = rules.getInteger ("reports." + type + ".spacing");
|
||||||
auto style = rules.get ("reports." + type + ".style");
|
auto style = rules.get ("reports." + type + ".style");
|
||||||
Color colorExc (palette.enabled ? rules.get ("theme.colors.exclusion") : "");
|
Color colorExc (palette.enabled ? rules.get ("theme.colors.exclusion") : "");
|
||||||
|
Color colorLabel (palette.enabled ? rules.get ("theme.colors.label") : "");
|
||||||
|
|
||||||
// Render the exclusion blocks.
|
// Render the exclusion blocks.
|
||||||
for (int hour = first_hour; hour <= last_hour; hour++)
|
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),
|
Range r (Datetime (day.year (), day.month (), day.day (), hour, 0, 0),
|
||||||
Datetime (day.year (), day.month (), day.day (), hour + 1, 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)
|
for (auto& exc : excluded)
|
||||||
{
|
{
|
||||||
if (exc.overlap (r))
|
if (exc.overlap (r))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue