|
@@ -278,9 +278,18 @@ namespace Terminal.Gui {
|
|
|
var rowToRender = RowOffset + (line - headerLinesConsumed);
|
|
|
|
|
|
//if we have run off the end of the table
|
|
|
- if (TableIsNullOrInvisible () || rowToRender >= Table.Rows.Count || rowToRender < 0)
|
|
|
+ if (TableIsNullOrInvisible () || rowToRender < 0)
|
|
|
continue;
|
|
|
|
|
|
+ // No more data
|
|
|
+ if(rowToRender >= Table.Rows.Count) {
|
|
|
+
|
|
|
+ if(rowToRender == Table.Rows.Count && Style.ShowHorizontalBottomline) {
|
|
|
+ RenderBottomLine (line, bounds.Width, columnsToRender);
|
|
|
+ }
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
RenderRow (line, rowToRender, columnsToRender);
|
|
|
}
|
|
|
}
|
|
@@ -474,6 +483,43 @@ namespace Terminal.Gui {
|
|
|
}
|
|
|
|
|
|
}
|
|
|
+
|
|
|
+ private void RenderBottomLine (int row, int availableWidth, ColumnToRender [] columnsToRender)
|
|
|
+ {
|
|
|
+ // Renders a line at the bottom of the table after all the data like:
|
|
|
+ // └─────────────────────────────────┴──────────┴──────┴──────────┴────────┴────────────────────────────────────────────┘
|
|
|
+
|
|
|
+ for (int c = 0; c < availableWidth; c++) {
|
|
|
+
|
|
|
+ // Start by assuming we just draw a straight line the
|
|
|
+ // whole way but update to instead draw BottomTee / Corner etc
|
|
|
+ var rune = Driver.HLine;
|
|
|
+
|
|
|
+ if (Style.ShowVerticalCellLines) {
|
|
|
+ if (c == 0) {
|
|
|
+ // for first character render line
|
|
|
+ rune = Driver.LLCorner;
|
|
|
+
|
|
|
+ }
|
|
|
+ // if the next column is the start of a header
|
|
|
+ else if (columnsToRender.Any (r => r.X == c + 1)) {
|
|
|
+ rune = Driver.BottomTee;
|
|
|
+ } else if (c == availableWidth - 1) {
|
|
|
+
|
|
|
+ // for the last character in the table
|
|
|
+ rune = Driver.LRCorner;
|
|
|
+
|
|
|
+ }
|
|
|
+ // if the next console column is the lastcolumns end
|
|
|
+ else if (Style.ExpandLastColumn == false &&
|
|
|
+ columnsToRender.Any (r => r.IsVeryLast && r.X + r.Width - 1 == c)) {
|
|
|
+ rune = Driver.BottomTee;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ AddRuneAt (Driver, c, row, rune);
|
|
|
+ }
|
|
|
+ }
|
|
|
private void RenderRow (int row, int rowToRender, ColumnToRender [] columnsToRender)
|
|
|
{
|
|
|
var focused = HasFocus;
|
|
@@ -1787,6 +1833,13 @@ namespace Terminal.Gui {
|
|
|
/// </summary>
|
|
|
public bool ShowHorizontalScrollIndicators { get; set; } = true;
|
|
|
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// Gets or sets a flag indicating whether there should be a horizontal line after all the data
|
|
|
+ /// in the table. Defaults to <see langword="false"/>.
|
|
|
+ /// </summary>
|
|
|
+ public bool ShowHorizontalBottomline { get; set; } = false;
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// True to invert the colors of the first symbol of the selected cell in the <see cref="TableView"/>.
|
|
|
/// This gives the appearance of a cursor for when the <see cref="ConsoleDriver"/> doesn't otherwise show
|