util: Added helper function to properly manage table header color/underline

This commit is contained in:
Paul Beckingham 2017-03-20 09:06:16 -04:00
parent 410bd2a22a
commit ac93381cd0
2 changed files with 31 additions and 1 deletions

View file

@ -303,3 +303,32 @@ const char* optionalBlankLine ()
}
////////////////////////////////////////////////////////////////////////////////
void setHeaderUnderline (Table& table)
{
// If an alternating row color is specified, notify the table.
if (context.color ())
{
Color alternate (context.config.get ("color.alternate"));
table.colorOdd (alternate);
table.intraColorOdd (alternate);
if (context.config.getBoolean ("fontunderline"))
{
table.colorHeader (Color ("underline " + context.config.get ("color.label")));
}
else
{
table.colorHeader (Color (context.config.get ("color.label")));
table.underlineHeaders ();
}
}
else
{
if (context.config.getBoolean ("fontunderline"))
table.colorHeader (Color ("underline"));
else
table.underlineHeaders ();
}
}
////////////////////////////////////////////////////////////////////////////////