mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
TW-161
- TW-161 UDA indicator (thanks to Jim B).
This commit is contained in:
parent
4622af1c35
commit
3f8095166e
4 changed files with 20 additions and 2 deletions
|
@ -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)));
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue