mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
ColUrgency: Now uses Column::render{Integer,Double}
This commit is contained in:
parent
4c55b8c9af
commit
43e4f8a485
1 changed files with 6 additions and 20 deletions
|
@ -51,15 +51,11 @@ ColumnUrgency::~ColumnUrgency ()
|
||||||
// Set the minimum and maximum widths for the value.
|
// Set the minimum and maximum widths for the value.
|
||||||
void ColumnUrgency::measure (Task& task, unsigned int& minimum, unsigned int& maximum)
|
void ColumnUrgency::measure (Task& task, unsigned int& minimum, unsigned int& maximum)
|
||||||
{
|
{
|
||||||
if (_style == "default" ||
|
if (_style == "default" || _style == "real")
|
||||||
_style == "real")
|
|
||||||
{
|
|
||||||
minimum = maximum = format (task.urgency (), 4, 3).length ();
|
minimum = maximum = format (task.urgency (), 4, 3).length ();
|
||||||
}
|
|
||||||
else if (_style == "integer")
|
else if (_style == "integer")
|
||||||
{
|
|
||||||
minimum = maximum = format ((int)task.urgency ()).length ();
|
minimum = maximum = format ((int)task.urgency ()).length ();
|
||||||
}
|
|
||||||
|
|
||||||
else
|
else
|
||||||
throw format (STRING_COLUMN_BAD_FORMAT, _name, _style);
|
throw format (STRING_COLUMN_BAD_FORMAT, _name, _style);
|
||||||
|
@ -72,21 +68,11 @@ void ColumnUrgency::render (
|
||||||
int width,
|
int width,
|
||||||
Color& color)
|
Color& color)
|
||||||
{
|
{
|
||||||
if (_style == "default" ||
|
if (_style == "default" || _style == "real")
|
||||||
_style == "real")
|
renderDouble (lines, width, color, task.urgency ());
|
||||||
{
|
|
||||||
lines.push_back (
|
|
||||||
color.colorize (
|
|
||||||
rightJustify (
|
|
||||||
format (task.urgency (), 4, 3), width)));
|
|
||||||
}
|
|
||||||
else if (_style == "integer")
|
else if (_style == "integer")
|
||||||
{
|
renderInteger (lines, width, color, static_cast <int> (task.urgency ()));
|
||||||
lines.push_back (
|
|
||||||
color.colorize (
|
|
||||||
rightJustify (
|
|
||||||
format ((int)task.urgency ()), width)));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue