Adds ShowHorizontalBottomline (#2552)

This commit is contained in:
Thomas Nind
2023-04-16 01:19:04 +01:00
committed by GitHub
parent 22efb32549
commit ba473ffe05
3 changed files with 124 additions and 1 deletions

View File

@@ -1991,6 +1991,68 @@ namespace Terminal.Gui.ViewsTests {
}
[Fact, AutoInitShutdown]
public void ShowHorizontalBottomLine_WithVerticalCellLines ()
{
var tableView = GetABCDEFTableView(out _);
tableView.BeginInit (); tableView.EndInit ();
tableView.ColorScheme = Colors.TopLevel;
// 3 columns are visibile
tableView.Bounds = new Rect (0, 0, 7, 5);
tableView.Style.ShowHorizontalHeaderUnderline = true;
tableView.Style.ShowHorizontalHeaderOverline = false;
tableView.Style.AlwaysShowHeaders = true;
tableView.Style.SmoothHorizontalScrolling = true;
tableView.Style.ShowHorizontalBottomline = true;
tableView.Redraw (tableView.Bounds);
// user can only scroll right so sees right indicator
// Because first column in table is A
string expected =
@"
│A│B│C│
├─┼─┼─►
│1│2│3│
└─┴─┴─┘";
TestHelpers.AssertDriverContentsAre (expected, output);
}
[Fact, AutoInitShutdown]
public void ShowHorizontalBottomLine_NoCellLines ()
{
var tableView = GetABCDEFTableView (out _);
tableView.BeginInit (); tableView.EndInit ();
tableView.ColorScheme = Colors.TopLevel;
// 3 columns are visibile
tableView.Bounds = new Rect (0, 0, 7, 5);
tableView.Style.ShowHorizontalHeaderUnderline = true;
tableView.Style.ShowHorizontalHeaderOverline = false;
tableView.Style.AlwaysShowHeaders = true;
tableView.Style.SmoothHorizontalScrolling = true;
tableView.Style.ShowHorizontalBottomline = true;
tableView.Style.ShowVerticalCellLines = false;
tableView.Redraw (tableView.Bounds);
// user can only scroll right so sees right indicator
// Because first column in table is A
string expected =
@"
│A│B│C│
└─┴─┴─►
1 2 3
───────";
TestHelpers.AssertDriverContentsAre (expected, output);
}
/// <summary>
/// Builds a simple table of string columns with the requested number of columns and rows
/// </summary>