mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-26 15:57:56 +01:00
* Initial plan * Remove LineView and replace all usages with Line - Deleted LineViewExample.cs scenario - Deleted LineViewTests.cs test file - Replaced LineView with Line in all examples (CollectionNavigatorTester, FileDialogExamples, LineExample, Wizard) - Replaced LineView with Line in all tests (ViewTests, TileViewTests) - Changed TileViewLineView to inherit from Line instead of LineView - Removed LineView.cs file - Removed LineView category from TileViewNesting scenario Co-authored-by: tig <585482+tig@users.noreply.github.com> * Remove LineView references from documentation - Updated Line.cs XML documentation to remove comparison with LineView - Removed LineView section from views.md documentation Co-authored-by: tig <585482+tig@users.noreply.github.com> * Fixes Wizard (#4269) * fixed Wizard * Made Line use GetAttributeForRole --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: tig <585482+tig@users.noreply.github.com> Co-authored-by: Tig <tig@users.noreply.github.com>
This commit is contained in:
@@ -338,7 +338,7 @@ public class ViewTests
|
||||
|
||||
top.Add (new Label { Text = "111" });
|
||||
v.Add (top);
|
||||
v.Add (new LineView (Orientation.Horizontal) { Y = 1 });
|
||||
v.Add (new Line { Orientation = Orientation.Horizontal, Y = 1 });
|
||||
bottom.Add (new Label { Text = "222" });
|
||||
v.Add (bottom);
|
||||
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
using UnitTests;
|
||||
|
||||
namespace Terminal.Gui.ViewsTests;
|
||||
|
||||
public class LineViewTests
|
||||
{
|
||||
[Fact]
|
||||
[AutoInitShutdown]
|
||||
public void LineView_DefaultConstructor ()
|
||||
{
|
||||
var horizontal = new LineView ();
|
||||
|
||||
Assert.Equal (Orientation.Horizontal, horizontal.Orientation);
|
||||
Assert.Equal (Dim.Fill (), horizontal.Width);
|
||||
horizontal.Layout ();
|
||||
Assert.Equal (1, horizontal.Frame.Height);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[AutoInitShutdown]
|
||||
public void LineView_Horizontal ()
|
||||
{
|
||||
var horizontal = new LineView (Orientation.Horizontal);
|
||||
|
||||
Assert.Equal (Orientation.Horizontal, horizontal.Orientation);
|
||||
Assert.Equal (Dim.Fill (), horizontal.Width);
|
||||
horizontal.Layout ();
|
||||
Assert.Equal (1, horizontal.Frame.Height);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[AutoInitShutdown]
|
||||
public void LineView_Vertical ()
|
||||
{
|
||||
var vert = new LineView (Orientation.Vertical);
|
||||
|
||||
Assert.Equal (Orientation.Vertical, vert.Orientation);
|
||||
Assert.Equal (Dim.Fill (), vert.Height);
|
||||
vert.Layout ();
|
||||
Assert.Equal (1, vert.Frame.Width);
|
||||
}
|
||||
}
|
||||
@@ -1630,7 +1630,7 @@ public class TileViewTests (ITestOutputHelper output)
|
||||
[AutoInitShutdown]
|
||||
public void TestTileView_Horizontal ()
|
||||
{
|
||||
TileView tileView = Get11By3TileView (out LineView line);
|
||||
TileView tileView = Get11By3TileView (out Line line);
|
||||
tileView.Orientation = Orientation.Horizontal;
|
||||
tileView.Layout ();
|
||||
tileView.Draw ();
|
||||
@@ -1654,7 +1654,7 @@ public class TileViewTests (ITestOutputHelper output)
|
||||
[AutoInitShutdown]
|
||||
public void TestTileView_Horizontal_Focused ()
|
||||
{
|
||||
TileView tileView = Get11By3TileView (out LineView line);
|
||||
TileView tileView = Get11By3TileView (out Line line);
|
||||
|
||||
tileView.Orientation = Orientation.Horizontal;
|
||||
tileView.NewKeyDownEvent (new (tileView.ToggleResizable));
|
||||
@@ -1700,7 +1700,7 @@ public class TileViewTests (ITestOutputHelper output)
|
||||
[AutoInitShutdown]
|
||||
public void TestTileView_Horizontal_View1MinSize_Absolute ()
|
||||
{
|
||||
TileView tileView = Get11By3TileView (out LineView line);
|
||||
TileView tileView = Get11By3TileView (out Line line);
|
||||
tileView.NewKeyDownEvent (new (tileView.ToggleResizable));
|
||||
|
||||
tileView.Orientation = Orientation.Horizontal;
|
||||
@@ -1792,7 +1792,7 @@ public class TileViewTests (ITestOutputHelper output)
|
||||
[AutoInitShutdown]
|
||||
public void TestTileView_InsertPanelAtEnd ()
|
||||
{
|
||||
TileView tileView = Get11By3TileView (out LineView line, true);
|
||||
TileView tileView = Get11By3TileView (out Line line, true);
|
||||
tileView.InsertTile (2);
|
||||
|
||||
tileView.Layout ();
|
||||
@@ -1811,7 +1811,7 @@ public class TileViewTests (ITestOutputHelper output)
|
||||
[AutoInitShutdown]
|
||||
public void TestTileView_InsertPanelAtStart ()
|
||||
{
|
||||
TileView tileView = Get11By3TileView (out LineView line, true);
|
||||
TileView tileView = Get11By3TileView (out Line line, true);
|
||||
tileView.InsertTile (0);
|
||||
|
||||
tileView.Layout ();
|
||||
@@ -1830,7 +1830,7 @@ public class TileViewTests (ITestOutputHelper output)
|
||||
[AutoInitShutdown]
|
||||
public void TestTileView_InsertPanelMiddle ()
|
||||
{
|
||||
TileView tileView = Get11By3TileView (out LineView line, true);
|
||||
TileView tileView = Get11By3TileView (out Line line, true);
|
||||
tileView.InsertTile (1);
|
||||
|
||||
tileView.Layout ();
|
||||
@@ -1849,7 +1849,7 @@ public class TileViewTests (ITestOutputHelper output)
|
||||
[AutoInitShutdown]
|
||||
public void TestTileView_Vertical ()
|
||||
{
|
||||
TileView tileView = Get11By3TileView (out LineView line);
|
||||
TileView tileView = Get11By3TileView (out Line line);
|
||||
|
||||
tileView.Layout ();
|
||||
tileView.Draw ();
|
||||
@@ -1872,7 +1872,7 @@ public class TileViewTests (ITestOutputHelper output)
|
||||
[AutoInitShutdown]
|
||||
public void TestTileView_Vertical_Focused ()
|
||||
{
|
||||
TileView tileView = Get11By3TileView (out LineView line);
|
||||
TileView tileView = Get11By3TileView (out Line line);
|
||||
tileView.NewKeyDownEvent (new (tileView.ToggleResizable));
|
||||
|
||||
AutoInitShutdownAttribute.RunIteration ();
|
||||
@@ -1913,7 +1913,7 @@ public class TileViewTests (ITestOutputHelper output)
|
||||
[AutoInitShutdown]
|
||||
public void TestTileView_Vertical_Focused_50PercentSplit ()
|
||||
{
|
||||
TileView tileView = Get11By3TileView (out LineView line);
|
||||
TileView tileView = Get11By3TileView (out Line line);
|
||||
tileView.SetSplitterPos (0, Pos.Percent (50));
|
||||
Assert.IsType<PosPercent> (tileView.SplitterDistances.ElementAt (0));
|
||||
tileView.NewKeyDownEvent (new (tileView.ToggleResizable));
|
||||
@@ -1961,7 +1961,7 @@ public class TileViewTests (ITestOutputHelper output)
|
||||
[AutoInitShutdown]
|
||||
public void TestTileView_Vertical_Focused_WithBorder ()
|
||||
{
|
||||
TileView tileView = Get11By3TileView (out LineView line, true);
|
||||
TileView tileView = Get11By3TileView (out Line line, true);
|
||||
tileView.NewKeyDownEvent (new (tileView.ToggleResizable));
|
||||
AutoInitShutdownAttribute.RunIteration ();
|
||||
|
||||
@@ -2001,7 +2001,7 @@ public class TileViewTests (ITestOutputHelper output)
|
||||
[AutoInitShutdown]
|
||||
public void TestTileView_Vertical_View1MinSize_Absolute ()
|
||||
{
|
||||
TileView tileView = Get11By3TileView (out LineView line);
|
||||
TileView tileView = Get11By3TileView (out Line line);
|
||||
tileView.NewKeyDownEvent (new (tileView.ToggleResizable));
|
||||
tileView.Tiles.ElementAt (0).MinSize = 6;
|
||||
|
||||
@@ -2044,7 +2044,7 @@ public class TileViewTests (ITestOutputHelper output)
|
||||
[AutoInitShutdown]
|
||||
public void TestTileView_Vertical_View1MinSize_Absolute_WithBorder ()
|
||||
{
|
||||
TileView tileView = Get11By3TileView (out LineView line, true);
|
||||
TileView tileView = Get11By3TileView (out Line line, true);
|
||||
tileView.NewKeyDownEvent (new (tileView.ToggleResizable));
|
||||
tileView.Tiles.ElementAt (0).MinSize = 5;
|
||||
|
||||
@@ -2087,7 +2087,7 @@ public class TileViewTests (ITestOutputHelper output)
|
||||
[AutoInitShutdown]
|
||||
public void TestTileView_Vertical_View2MinSize_Absolute ()
|
||||
{
|
||||
TileView tileView = Get11By3TileView (out LineView line);
|
||||
TileView tileView = Get11By3TileView (out Line line);
|
||||
tileView.NewKeyDownEvent (new (tileView.ToggleResizable));
|
||||
tileView.Tiles.ElementAt (1).MinSize = 6;
|
||||
AutoInitShutdownAttribute.RunIteration ();
|
||||
@@ -2132,7 +2132,7 @@ public class TileViewTests (ITestOutputHelper output)
|
||||
[AutoInitShutdown]
|
||||
public void TestTileView_Vertical_View2MinSize_Absolute_WithBorder ()
|
||||
{
|
||||
TileView tileView = Get11By3TileView (out LineView line, true);
|
||||
TileView tileView = Get11By3TileView (out Line line, true);
|
||||
tileView.NewKeyDownEvent (new (tileView.ToggleResizable));
|
||||
tileView.Tiles.ElementAt (1).MinSize = 5;
|
||||
|
||||
@@ -2177,7 +2177,7 @@ public class TileViewTests (ITestOutputHelper output)
|
||||
[AutoInitShutdown]
|
||||
public void TestTileView_Vertical_WithBorder ()
|
||||
{
|
||||
TileView tileView = Get11By3TileView (out LineView line, true);
|
||||
TileView tileView = Get11By3TileView (out Line line, true);
|
||||
|
||||
AutoInitShutdownAttribute.RunIteration ();
|
||||
|
||||
@@ -2210,7 +2210,7 @@ public class TileViewTests (ITestOutputHelper output)
|
||||
Assert.Empty (tv.Tiles.ElementAt (0).Title);
|
||||
}
|
||||
|
||||
private TileView Get11By3TileView (out LineView line, bool withBorder = false)
|
||||
private TileView Get11By3TileView (out Line line, bool withBorder = false)
|
||||
{
|
||||
TileView split = Get11By3TileView (withBorder);
|
||||
line = GetLine (split);
|
||||
@@ -2267,7 +2267,7 @@ public class TileViewTests (ITestOutputHelper output)
|
||||
return tv;
|
||||
}
|
||||
|
||||
private LineView GetLine (TileView tileView) { return tileView.SubViews.OfType<LineView> ().Single (); }
|
||||
private Line GetLine (TileView tileView) { return tileView.SubViews.OfType<Line> ().Single (); }
|
||||
|
||||
/// <summary>Creates a vertical orientation root container with left pane split into two (with horizontal splitter line).</summary>
|
||||
/// <param name="withBorder"></param>
|
||||
|
||||
Reference in New Issue
Block a user