mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Color
- Supports 'color.label.sort' for column labels of sort columns.
This commit is contained in:
parent
aac0753b07
commit
39469a1917
5 changed files with 22 additions and 1 deletions
|
@ -128,10 +128,16 @@ int CmdCustom::execute (std::string& output)
|
|||
Color label (context.config.get ("color.label"));
|
||||
view.colorHeader (label);
|
||||
|
||||
Color label_sort (context.config.get ("color.label.sort"));
|
||||
view.colorSortHeader (label_sort);
|
||||
|
||||
Color alternate (context.config.get ("color.alternate"));
|
||||
view.colorOdd (alternate);
|
||||
view.intraColorOdd (alternate);
|
||||
|
||||
// Capture columns that are sorted.
|
||||
std::vector <std::string> sortColumns;
|
||||
|
||||
// Add the break columns, if any.
|
||||
std::vector <std::string>::iterator so;
|
||||
for (so = sortOrder.begin (); so != sortOrder.end (); ++so)
|
||||
|
@ -143,6 +149,8 @@ int CmdCustom::execute (std::string& output)
|
|||
|
||||
if (breakIndicator)
|
||||
view.addBreak (name);
|
||||
|
||||
sortColumns.push_back (name);
|
||||
}
|
||||
|
||||
// Add the columns and labels.
|
||||
|
@ -151,7 +159,12 @@ int CmdCustom::execute (std::string& output)
|
|||
Column* c = Column::factory (columns[i], _keyword);
|
||||
if (i < labels.size ())
|
||||
c->setLabel (labels[i]);
|
||||
view.add (c);
|
||||
|
||||
bool sort = std::find (sortColumns.begin (), sortColumns.end (), c->name ()) != sortColumns.end ()
|
||||
? true
|
||||
: false;
|
||||
|
||||
view.add (c, sort);
|
||||
}
|
||||
|
||||
// How many lines taken up by table header?
|
||||
|
|
|
@ -107,6 +107,7 @@ int CmdShow::execute (std::string& output)
|
|||
" color.history.delete"
|
||||
" color.history.done"
|
||||
" color.label"
|
||||
" color.label.sort"
|
||||
" color.overdue"
|
||||
" color.pri.H"
|
||||
" color.pri.L"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue