Selaa lähdekoodia

Fixes merge errors.

BDisp 2 vuotta sitten
vanhempi
commit
29af067e01

+ 8 - 6
Terminal.Gui/Core/Border.cs

@@ -331,6 +331,7 @@ namespace Terminal.Gui {
 		private Point effect3DOffset = new Point (1, 1);
 		private Attribute? effect3DBrush;
 		private ustring title = ustring.Empty;
+		private View child;
 
 		/// <summary>
 		/// Specifies the <see cref="Gui.BorderStyle"/> for a view.
@@ -650,7 +651,7 @@ namespace Terminal.Gui {
 				Child.Clear (borderRect);
 			}
 
-			driver.SetAttribute (savedAttribute);
+			driver.SetAttribute (new Attribute (BorderBrush, Background));
 
 			// Draw margin frame
 			if (DrawMarginFrame) {
@@ -674,6 +675,7 @@ namespace Terminal.Gui {
 					driver.DrawWindowFrame (borderRect, 1, 1, 1, 1, BorderStyle != BorderStyle.None, fill: true, this);
 				}
 			}
+			driver.SetAttribute (savedAttribute);
 		}
 
 		private void DrawChildBorder (Rect frame, bool fill = true)
@@ -786,7 +788,7 @@ namespace Terminal.Gui {
 				}
 			}
 
-			driver.SetAttribute (savedAttribute);
+			driver.SetAttribute (new Attribute (BorderBrush, Background));
 
 			// Draw the MarginFrame
 			if (DrawMarginFrame) {
@@ -983,7 +985,7 @@ namespace Terminal.Gui {
 				}
 			}
 
-			driver.SetAttribute (savedAttribute);
+			driver.SetAttribute (new Attribute (BorderBrush, Background));
 
 			// Draw the MarginFrame
 			if (DrawMarginFrame) {
@@ -1077,7 +1079,7 @@ namespace Terminal.Gui {
 					driver.DrawWindowTitle (scrRect, Title, 0, 0, 0, 0);
 				} else {
 					scrRect = view.ViewToScreen (new Rect (0, 0, view.Frame.Width, view.Frame.Height));
-					driver.DrawWindowTitle (scrRect, Title,
+					driver.DrawWindowTitle (scrRect, Parent.Border.Title,
 						padding.Left, padding.Top, padding.Right, padding.Bottom);
 				}
 			}
@@ -1093,9 +1095,9 @@ namespace Terminal.Gui {
 		{
 			var driver = Application.Driver;
 			if (DrawMarginFrame) {
-				driver.SetAttribute (view.GetNormalColor ());
+				driver.SetAttribute (new Attribute (BorderBrush, Background));
 				if (view.HasFocus) {
-					driver.SetAttribute (view.ColorScheme.HotNormal);
+					driver.SetAttribute (new Attribute (view.ColorScheme.HotNormal.Foreground, Background));
 				}
 				var padding = Parent.Border.GetSumThickness ();
 				var scrRect = Parent.ViewToScreen (new Rect (0, 0, rect.Width, rect.Height));

+ 1 - 4
Terminal.Gui/Views/FrameView.cs

@@ -268,12 +268,8 @@ namespace Terminal.Gui {
 		///<inheritdoc/>
 		public override void Redraw (Rect bounds)
 		{
-			var padding = Border.GetSumThickness ();
-			var scrRect = ViewToScreen (new Rect (0, 0, Frame.Width, Frame.Height));
-
 			if (!NeedDisplay.IsEmpty) {
 				Driver.SetAttribute (GetNormalColor ());
-				//Driver.DrawWindowFrame (scrRect, padding + 1, padding + 1, padding + 1, padding + 1, border: true, fill: true);
 				Clear ();
 			}
 
@@ -281,6 +277,7 @@ namespace Terminal.Gui {
 			contentView.Redraw (!NeedDisplay.IsEmpty ? contentView.Bounds : bounds);
 			Driver.Clip = savedClip;
 
+			ClearLayoutNeeded ();
 			ClearNeedsDisplay ();
 
 			if (!IgnoreBorderPropertyOnRedraw) {

+ 3 - 3
UICatalog/UICatalog.cs

@@ -195,9 +195,9 @@ namespace UICatalog {
 			// Run UI Catalog UI. When it exits, if _selectedScenario is != null then
 			// a Scenario was selected. Otherwise, the user wants to exit UI Catalog.
 			Application.Init ();
-			
-			//Application.EnableConsoleScrolling = _enableConsoleScrolling;
-			
+
+			Application.EnableConsoleScrolling = _enableConsoleScrolling;
+
 			Application.Run<UICatalogTopLevel> ();
 			Application.Shutdown ();
 

+ 2 - 2
UnitTests/Core/BorderTests.cs

@@ -230,7 +230,7 @@ namespace Terminal.Gui.CoreTests {
 					var rune = (Rune)driver.Contents [r, c, 0];
 					if (r == frame.Y - drawMarginFrame || r == frame.Bottom + drawMarginFrame - 1
 						|| c == frame.X - drawMarginFrame || c == frame.Right + drawMarginFrame - 1) {
-						Assert.Equal (Color.Black, color.Background);  // because of #2345 - Border: can't change border color in window by Border.BorderBrush. 
+						Assert.Equal (Color.BrightGreen, color.Background);
 					} else {
 						Assert.Equal (Color.Black, color.Background);
 					}
@@ -464,7 +464,7 @@ namespace Terminal.Gui.CoreTests {
 					var rune = (Rune)driver.Contents [r, c, 0];
 					if (r == frame.Y + sumThickness.Top || r == frame.Bottom - sumThickness.Bottom - 1
 						|| c == frame.X + sumThickness.Left || c == frame.Right - sumThickness.Right - 1) {
-						Assert.Equal (Color.Black, color.Background);  // because of #2345 - Border: can't change border color in window by Border.BorderBrush. 
+						Assert.Equal (Color.BrightGreen, color.Background);
 					} else {
 						Assert.Equal (Color.Black, color.Background);
 					}