- TW-161 UDA indicator (thanks to Jim B).
This commit is contained in:
Paul Beckingham 2014-12-27 15:30:41 -05:00
parent 4622af1c35
commit 3f8095166e
4 changed files with 20 additions and 2 deletions

View file

@ -48,8 +48,7 @@ ColumnUDA::ColumnUDA ()
_hyphenate = (_type == "string") ? true : false;
_styles.push_back (_style);
// TODO _examples.push_back ("?");
_styles.push_back ("indicator");
}
////////////////////////////////////////////////////////////////////////////////
@ -117,6 +116,11 @@ void ColumnUDA::measure (Task& task, unsigned int& minimum, unsigned int& maximu
}
}
}
else if (_style == "indicator")
{
if (task.has (_name))
minimum = maximum = utf8_width (context.config.get ("uda." + _name + ".indicator"));
}
else
throw format (STRING_COLUMN_BAD_FORMAT, _name, _style);
}
@ -174,6 +178,13 @@ void ColumnUDA::render (
}
}
}
else if (_style == "indicator")
{
if (task.has (_name))
lines.push_back (
color.colorize (
rightJustify (context.config.get ("uda." + _name + ".indicator"), width)));
}
}
////////////////////////////////////////////////////////////////////////////////