mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
TW-1547
- TW-1547 Recur column is always shown even if no recurring task is displayed (thanks to Renato Alves).
This commit is contained in:
parent
d2b2631db7
commit
f2998aba74
10 changed files with 209 additions and 158 deletions
|
@ -62,11 +62,16 @@ bool ColumnIMask::validate (std::string& value)
|
|||
// Set the minimum and maximum widths for the value.
|
||||
void ColumnIMask::measure (Task& task, unsigned int& minimum, unsigned int& maximum)
|
||||
{
|
||||
minimum = maximum = task.get ("imask").length ();
|
||||
minimum = maximum = 0;
|
||||
|
||||
if (_style != "default" &&
|
||||
_style != "number")
|
||||
throw format (STRING_COLUMN_BAD_FORMAT, _name, _style);
|
||||
if (task.has (_name))
|
||||
{
|
||||
minimum = maximum = task.get ("imask").length ();
|
||||
|
||||
if (_style != "default" &&
|
||||
_style != "number")
|
||||
throw format (STRING_COLUMN_BAD_FORMAT, _name, _style);
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -76,7 +81,8 @@ void ColumnIMask::render (
|
|||
int width,
|
||||
Color& color)
|
||||
{
|
||||
lines.push_back (color.colorize (rightJustify (task.get ("imask"), width)));
|
||||
if (task.has (_name))
|
||||
lines.push_back (color.colorize (rightJustify (task.get ("imask"), width)));
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue