mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
- Task now uses dashes (-----) to underline column headings when color is
disabled (thanks for Vincent Fleuranceau).
This commit is contained in:
parent
11225eb599
commit
4abc722eff
6 changed files with 110 additions and 3 deletions
|
@ -143,7 +143,7 @@ void handleList (TDB& tdb, T& task, Config& conf)
|
|||
if (showAge) table.addColumn ("Age");
|
||||
table.addColumn ("Description");
|
||||
|
||||
if (conf.get ("color", true))
|
||||
if (conf.get (std::string ("color"), true))
|
||||
{
|
||||
table.setColumnUnderline (0);
|
||||
table.setColumnUnderline (1);
|
||||
|
@ -153,6 +153,8 @@ void handleList (TDB& tdb, T& task, Config& conf)
|
|||
table.setColumnUnderline (5);
|
||||
if (showAge) table.setColumnUnderline (6);
|
||||
}
|
||||
else
|
||||
table.setTableDashedUnderline ();
|
||||
|
||||
table.setColumnWidth (0, Table::minimum);
|
||||
table.setColumnWidth (1, Table::minimum);
|
||||
|
@ -291,6 +293,8 @@ void handleSmallList (TDB& tdb, T& task, Config& conf)
|
|||
table.setColumnUnderline (2);
|
||||
table.setColumnUnderline (3);
|
||||
}
|
||||
else
|
||||
table.setTableDashedUnderline ();
|
||||
|
||||
table.setColumnWidth (0, Table::minimum);
|
||||
table.setColumnWidth (1, Table::minimum);
|
||||
|
@ -414,6 +418,8 @@ void handleCompleted (TDB& tdb, T& task, Config& conf)
|
|||
table.setColumnUnderline (1);
|
||||
table.setColumnUnderline (2);
|
||||
}
|
||||
else
|
||||
table.setTableDashedUnderline ();
|
||||
|
||||
table.setColumnWidth (0, Table::minimum);
|
||||
table.setColumnWidth (1, Table::minimum);
|
||||
|
@ -493,6 +499,8 @@ void handleInfo (TDB& tdb, T& task, Config& conf)
|
|||
table.setColumnUnderline (0);
|
||||
table.setColumnUnderline (1);
|
||||
}
|
||||
else
|
||||
table.setTableDashedUnderline ();
|
||||
|
||||
table.setColumnWidth (0, Table::minimum);
|
||||
table.setColumnWidth (1, Table::minimum);
|
||||
|
@ -710,6 +718,8 @@ void handleLongList (TDB& tdb, T& task, Config& conf)
|
|||
table.setColumnUnderline (7);
|
||||
if (showAge) table.setColumnUnderline (8);
|
||||
}
|
||||
else
|
||||
table.setTableDashedUnderline ();
|
||||
|
||||
table.setColumnWidth (0, Table::minimum);
|
||||
table.setColumnWidth (1, Table::minimum);
|
||||
|
@ -913,6 +923,8 @@ void handleReportSummary (TDB& tdb, T& task, Config& conf)
|
|||
table.setColumnUnderline (2);
|
||||
table.setColumnUnderline (3);
|
||||
}
|
||||
else
|
||||
table.setTableDashedUnderline ();
|
||||
|
||||
table.setColumnJustification (1, Table::right);
|
||||
table.setColumnJustification (2, Table::right);
|
||||
|
@ -1056,6 +1068,8 @@ void handleReportNext (TDB& tdb, T& task, Config& conf)
|
|||
table.setColumnUnderline (5);
|
||||
if (showAge) table.setColumnUnderline (6);
|
||||
}
|
||||
else
|
||||
table.setTableDashedUnderline ();
|
||||
|
||||
table.setColumnWidth (0, Table::minimum);
|
||||
table.setColumnWidth (1, Table::minimum);
|
||||
|
@ -1275,6 +1289,8 @@ void handleReportHistory (TDB& tdb, T& task, Config& conf)
|
|||
table.setColumnUnderline (4);
|
||||
table.setColumnUnderline (5);
|
||||
}
|
||||
else
|
||||
table.setTableDashedUnderline ();
|
||||
|
||||
table.setColumnJustification (2, Table::right);
|
||||
table.setColumnJustification (3, Table::right);
|
||||
|
@ -1462,6 +1478,8 @@ void handleReportGHistory (TDB& tdb, T& task, Config& conf)
|
|||
table.setColumnUnderline (0);
|
||||
table.setColumnUnderline (1);
|
||||
}
|
||||
else
|
||||
table.setTableDashedUnderline ();
|
||||
|
||||
// Determine the longest line.
|
||||
int maxLine = 0;
|
||||
|
@ -1623,6 +1641,8 @@ void handleReportUsage (const TDB& tdb, T& task, Config& conf)
|
|||
table.setColumnUnderline (0);
|
||||
table.setColumnUnderline (1);
|
||||
}
|
||||
else
|
||||
table.setTableDashedUnderline ();
|
||||
|
||||
table.setColumnJustification (1, Table::right);
|
||||
table.sortOn (1, Table::descendingNumeric);
|
||||
|
@ -1681,6 +1701,8 @@ std::string renderMonths (
|
|||
table.setColumnUnderline (i + 6);
|
||||
table.setColumnUnderline (i + 7);
|
||||
}
|
||||
else
|
||||
table.setTableDashedUnderline ();
|
||||
|
||||
table.setColumnJustification (i + 0, Table::right);
|
||||
table.setColumnJustification (i + 1, Table::right);
|
||||
|
@ -1896,6 +1918,8 @@ void handleReportActive (TDB& tdb, T& task, Config& conf)
|
|||
table.setColumnUnderline (3);
|
||||
table.setColumnUnderline (4);
|
||||
}
|
||||
else
|
||||
table.setTableDashedUnderline ();
|
||||
|
||||
table.setColumnWidth (0, Table::minimum);
|
||||
table.setColumnWidth (1, Table::minimum);
|
||||
|
@ -2011,6 +2035,8 @@ void handleReportOverdue (TDB& tdb, T& task, Config& conf)
|
|||
table.setColumnUnderline (3);
|
||||
table.setColumnUnderline (4);
|
||||
}
|
||||
else
|
||||
table.setTableDashedUnderline ();
|
||||
|
||||
table.setColumnWidth (0, Table::minimum);
|
||||
table.setColumnWidth (1, Table::minimum);
|
||||
|
@ -2126,6 +2152,8 @@ void handleReportOldest (TDB& tdb, T& task, Config& conf)
|
|||
table.setColumnUnderline (5);
|
||||
if (showAge) table.setColumnUnderline (6);
|
||||
}
|
||||
else
|
||||
table.setTableDashedUnderline ();
|
||||
|
||||
table.setColumnWidth (0, Table::minimum);
|
||||
table.setColumnWidth (1, Table::minimum);
|
||||
|
@ -2269,6 +2297,8 @@ void handleReportNewest (TDB& tdb, T& task, Config& conf)
|
|||
table.setColumnUnderline (5);
|
||||
if (showAge) table.setColumnUnderline (6);
|
||||
}
|
||||
else
|
||||
table.setTableDashedUnderline ();
|
||||
|
||||
table.setColumnWidth (0, Table::minimum);
|
||||
table.setColumnWidth (1, Table::minimum);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue