mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
View
- Fixed problem with incorrect Color vector addressing. - Modified ViewText to not underline empty column headers. - Implemented ViewText::set method to set only color.
This commit is contained in:
parent
f0f3e55cc6
commit
f8b44b68d7
5 changed files with 37 additions and 26 deletions
|
@ -68,7 +68,7 @@ void ViewText::set (int row, int col, const std::string& value, Color color)
|
|||
_data[row][col] = value;
|
||||
|
||||
if (color.nontrivial () &&
|
||||
! context.color ())
|
||||
context.color ())
|
||||
_color[row][col] = color;
|
||||
}
|
||||
|
||||
|
@ -79,7 +79,7 @@ void ViewText::set (int row, int col, int value, Color color)
|
|||
_data[row][col] = string_value;
|
||||
|
||||
if (color.nontrivial () &&
|
||||
! context.color ())
|
||||
context.color ())
|
||||
_color[row][col] = color;
|
||||
}
|
||||
|
||||
|
@ -90,7 +90,15 @@ void ViewText::set (int row, int col, float value, int width, int precision, Col
|
|||
_data[row][col] = string_value;
|
||||
|
||||
if (color.nontrivial () &&
|
||||
! context.color ())
|
||||
context.color ())
|
||||
_color[row][col] = color;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void ViewText::set (int row, int col, Color color)
|
||||
{
|
||||
if (color.nontrivial () &&
|
||||
context.color ())
|
||||
_color[row][col] = color;
|
||||
}
|
||||
|
||||
|
@ -144,7 +152,8 @@ std::string ViewText::render ()
|
|||
if (sum_ideal <= overage)
|
||||
widths = ideal;
|
||||
else if (sum_minimal > overage)
|
||||
throw std::string ("There is not enough horizontal width to display the results.");
|
||||
// throw std::string ("There is not enough horizontal width to display the results.");
|
||||
widths = minimal;
|
||||
else
|
||||
{
|
||||
widths = minimal;
|
||||
|
@ -199,7 +208,7 @@ std::string ViewText::render ()
|
|||
if (c)
|
||||
out += intra;
|
||||
|
||||
if (headers[i].size () < max_lines - i)
|
||||
if (headers[c].size () < max_lines - i)
|
||||
out += _header.colorize (std::string (widths[c], ' '));
|
||||
else
|
||||
out += headers[c][i];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue