Browse Source

Whitespace layout fix

tznind 2 years ago
parent
commit
34e517be57
2 changed files with 27 additions and 27 deletions
  1. 2 2
      Terminal.Gui/Views/TileView.cs
  2. 25 25
      UnitTests/TileViewTests.cs

+ 2 - 2
Terminal.Gui/Views/TileView.cs

@@ -513,10 +513,10 @@ namespace Terminal.Gui {
 				var spaceForLast = newSize - lastSplitterOrBorder;
 				var spaceForLast = newSize - lastSplitterOrBorder;
 
 
 				// space required for the line itself
 				// space required for the line itself
-				if(idx > 0) {
+				if (idx > 0) {
 					spaceForLast--;
 					spaceForLast--;
 				}
 				}
-					
+
 
 
 				// don't shrink if it would take us below min size of left panel
 				// don't shrink if it would take us below min size of left panel
 				if (spaceForLast < tiles [idx].MinSize) {
 				if (spaceForLast < tiles [idx].MinSize) {

+ 25 - 25
UnitTests/TileViewTests.cs

@@ -213,10 +213,10 @@ namespace UnitTests {
 			tileView.Tiles.ElementAt (0).MinSize = 6;
 			tileView.Tiles.ElementAt (0).MinSize = 6;
 
 
 			// distance is too small (below 6)
 			// distance is too small (below 6)
-			Assert.False(tileView.SetSplitterPos (0, 2));
+			Assert.False (tileView.SetSplitterPos (0, 2));
 
 
 			// Should stay where it was originally at (50%)
 			// Should stay where it was originally at (50%)
-			Assert.Equal (Pos.Percent(50), tileView.SplitterDistances.ElementAt (0));
+			Assert.Equal (Pos.Percent (50), tileView.SplitterDistances.ElementAt (0));
 
 
 			tileView.Redraw (tileView.Bounds);
 			tileView.Redraw (tileView.Bounds);
 
 
@@ -258,10 +258,10 @@ namespace UnitTests {
 			tileView.Tiles.ElementAt (0).MinSize = 5;
 			tileView.Tiles.ElementAt (0).MinSize = 5;
 
 
 			// distance is too small (below 5)
 			// distance is too small (below 5)
-			Assert.False(tileView.SetSplitterPos (0, 2));
+			Assert.False (tileView.SetSplitterPos (0, 2));
 
 
 			// Should stay where it was originally at (50%)
 			// Should stay where it was originally at (50%)
-			Assert.Equal (Pos.Percent(50), tileView.SplitterDistances.ElementAt (0));
+			Assert.Equal (Pos.Percent (50), tileView.SplitterDistances.ElementAt (0));
 
 
 			tileView.Redraw (tileView.Bounds);
 			tileView.Redraw (tileView.Bounds);
 
 
@@ -302,10 +302,10 @@ namespace UnitTests {
 			tileView.Tiles.ElementAt (1).MinSize = 6;
 			tileView.Tiles.ElementAt (1).MinSize = 6;
 
 
 			// distance leaves too little space for view2 (less than 6 would remain)
 			// distance leaves too little space for view2 (less than 6 would remain)
-			Assert.False(tileView.SetSplitterPos (0, 8));
+			Assert.False (tileView.SetSplitterPos (0, 8));
 
 
 			//  Should stay where it was originally at (50%)
 			//  Should stay where it was originally at (50%)
-			Assert.Equal (Pos.Percent(50), tileView.SplitterDistances.ElementAt (0));
+			Assert.Equal (Pos.Percent (50), tileView.SplitterDistances.ElementAt (0));
 
 
 			tileView.Redraw (tileView.Bounds);
 			tileView.Redraw (tileView.Bounds);
 
 
@@ -346,10 +346,10 @@ namespace UnitTests {
 			tileView.Tiles.ElementAt (1).MinSize = 5;
 			tileView.Tiles.ElementAt (1).MinSize = 5;
 
 
 			// distance leaves too little space for view2 (less than 5 would remain)
 			// distance leaves too little space for view2 (less than 5 would remain)
-			Assert.False(tileView.SetSplitterPos (0, 8));
+			Assert.False (tileView.SetSplitterPos (0, 8));
 
 
 			//  Should stay where it was originally at (50%)
 			//  Should stay where it was originally at (50%)
-			Assert.Equal (Pos.Percent(50), tileView.SplitterDistances.ElementAt (0));
+			Assert.Equal (Pos.Percent (50), tileView.SplitterDistances.ElementAt (0));
 
 
 			tileView.Redraw (tileView.Bounds);
 			tileView.Redraw (tileView.Bounds);
 
 
@@ -490,9 +490,9 @@ namespace UnitTests {
 			tileView.Tiles.ElementAt (0).MinSize = 1;
 			tileView.Tiles.ElementAt (0).MinSize = 1;
 
 
 			// 0 should not be allowed because it brings us below minimum size of View1
 			// 0 should not be allowed because it brings us below minimum size of View1
-			Assert.False(tileView.SetSplitterPos (0, 0));
+			Assert.False (tileView.SetSplitterPos (0, 0));
 			// position should remain where it was, at 50%
 			// position should remain where it was, at 50%
-			Assert.Equal (Pos.Percent(50f), tileView.SplitterDistances.ElementAt (0));
+			Assert.Equal (Pos.Percent (50f), tileView.SplitterDistances.ElementAt (0));
 
 
 			tileView.Redraw (tileView.Bounds);
 			tileView.Redraw (tileView.Bounds);
 
 
@@ -906,12 +906,12 @@ namespace UnitTests {
 			TestHelpers.AssertDriverContentsAre (looksLike, output);
 			TestHelpers.AssertDriverContentsAre (looksLike, output);
 		}
 		}
 
 
-		[Fact,AutoInitShutdown]
-		public void Test5Panel_MinSizes_VerticalSplitters_ResizeSplitter1()
+		[Fact, AutoInitShutdown]
+		public void Test5Panel_MinSizes_VerticalSplitters_ResizeSplitter1 ()
 		{
 		{
-			var tv = Get5x1TilesView();
+			var tv = Get5x1TilesView ();
 
 
-			tv.Tiles.ElementAt(0).MinSize = int.MaxValue;
+			tv.Tiles.ElementAt (0).MinSize = int.MaxValue;
 
 
 			tv.Redraw (tv.Bounds);
 			tv.Redraw (tv.Bounds);
 
 
@@ -924,7 +924,7 @@ namespace UnitTests {
 ";
 ";
 			TestHelpers.AssertDriverContentsAre (looksLike, output);
 			TestHelpers.AssertDriverContentsAre (looksLike, output);
 
 
-			for(int x=0;x<=5;x++) {
+			for (int x = 0; x <= 5; x++) {
 				// All these values would result in tile 0 getting smaller
 				// All these values would result in tile 0 getting smaller
 				// so are not allowed (tile[0] has a min size of Int.Max)
 				// so are not allowed (tile[0] has a min size of Int.Max)
 				Assert.False (tv.SetSplitterPos (0, x), $"Assert failed for x={x}");
 				Assert.False (tv.SetSplitterPos (0, x), $"Assert failed for x={x}");
@@ -933,7 +933,7 @@ namespace UnitTests {
 			for (int x = 6; x < 10; x++) {
 			for (int x = 6; x < 10; x++) {
 				// All these values would result in tile 0 getting bigger
 				// All these values would result in tile 0 getting bigger
 				// so are allowed
 				// so are allowed
-				Assert.True (tv.SetSplitterPos (0, x),$"Assert failed for x={x}");
+				Assert.True (tv.SetSplitterPos (0, x), $"Assert failed for x={x}");
 			}
 			}
 
 
 
 
@@ -1668,7 +1668,7 @@ namespace UnitTests {
 
 
 			tileView.Redraw (tileView.Bounds);
 			tileView.Redraw (tileView.Bounds);
 
 
-			 looksLike =
+			looksLike =
 @"
 @"
 ┌────────────┬─────┐
 ┌────────────┬─────┐
 │222222222222│33333│
 │222222222222│33333│
@@ -1854,7 +1854,7 @@ namespace UnitTests {
 
 
 			tileView.Redraw (tileView.Bounds);
 			tileView.Redraw (tileView.Bounds);
 
 
-			 looksLike =
+			looksLike =
 @"
 @"
 2222222222222│333333
 2222222222222│333333
 2222222222222│333333
 2222222222222│333333
@@ -2081,17 +2081,17 @@ namespace UnitTests {
 
 
 		private TileView Get5x1TilesView (bool border = true)
 		private TileView Get5x1TilesView (bool border = true)
 		{
 		{
-			var tv = new TileView (5){ Width = 25, Height = 4, ColorScheme = new ColorScheme (), IntegratedBorder = BorderStyle.Single };
+			var tv = new TileView (5) { Width = 25, Height = 4, ColorScheme = new ColorScheme (), IntegratedBorder = BorderStyle.Single };
 
 
-			if(!border) {
+			if (!border) {
 				tv.IntegratedBorder = BorderStyle.None;
 				tv.IntegratedBorder = BorderStyle.None;
 			}
 			}
 
 
-			tv.Tiles.ElementAt (0).View.Add (new Label(new string('1',100)){AutoSize=false,Width=Dim.Fill(),Height = 1});
-			tv.Tiles.ElementAt (1).View.Add (new Label(new string('2',100)){AutoSize=false,Width=Dim.Fill(),Height = 1});
-			tv.Tiles.ElementAt (2).View.Add (new Label(new string('3',100)){AutoSize=false,Width=Dim.Fill(),Height = 1});
-			tv.Tiles.ElementAt (3).View.Add (new Label(new string('4',100)){AutoSize=false,Width=Dim.Fill(),Height = 1});
-			tv.Tiles.ElementAt (4).View.Add (new Label(new string('5',100)){AutoSize=false,Width=Dim.Fill(),Height = 1});
+			tv.Tiles.ElementAt (0).View.Add (new Label (new string ('1', 100)) { AutoSize = false, Width = Dim.Fill (), Height = 1 });
+			tv.Tiles.ElementAt (1).View.Add (new Label (new string ('2', 100)) { AutoSize = false, Width = Dim.Fill (), Height = 1 });
+			tv.Tiles.ElementAt (2).View.Add (new Label (new string ('3', 100)) { AutoSize = false, Width = Dim.Fill (), Height = 1 });
+			tv.Tiles.ElementAt (3).View.Add (new Label (new string ('4', 100)) { AutoSize = false, Width = Dim.Fill (), Height = 1 });
+			tv.Tiles.ElementAt (4).View.Add (new Label (new string ('5', 100)) { AutoSize = false, Width = Dim.Fill (), Height = 1 });
 
 
 			Application.Top.Add (tv);
 			Application.Top.Add (tv);
 			tv.BeginInit ();
 			tv.BeginInit ();