Browse Source

re-merged changes lost from #2345

Tigger Kindel 2 years ago
parent
commit
c192f8d4c4
1 changed files with 8 additions and 10 deletions
  1. 8 10
      Terminal.Gui/Core/View.cs

+ 8 - 10
Terminal.Gui/Core/View.cs

@@ -1521,14 +1521,12 @@ namespace Terminal.Gui {
 				Driver.SetAttribute (HasFocus ? GetFocusColor () : GetNormalColor ());
 				Driver.SetAttribute (HasFocus ? GetFocusColor () : GetNormalColor ());
 			}
 			}
 
 
-			var boundsAdjustedForBorder = Bounds;
 			if (!IgnoreBorderPropertyOnRedraw && Border != null) {
 			if (!IgnoreBorderPropertyOnRedraw && Border != null) {
 				Border.DrawContent (this);
 				Border.DrawContent (this);
-				boundsAdjustedForBorder = Bounds;// new Rect (bounds.X + 1, bounds.Y + 1, Math.Max (bounds.Width, bounds.Width - 2), Math.Max (bounds.Height, bounds.Height - 2));
 			} else if (ustring.IsNullOrEmpty (TextFormatter.Text) &&
 			} else if (ustring.IsNullOrEmpty (TextFormatter.Text) &&
 				(GetType ().IsNestedPublic && !IsOverridden (this, "Redraw") || GetType ().Name == "View") &&
 				(GetType ().IsNestedPublic && !IsOverridden (this, "Redraw") || GetType ().Name == "View") &&
 				(!NeedDisplay.IsEmpty || ChildNeedsDisplay || LayoutNeeded)) {
 				(!NeedDisplay.IsEmpty || ChildNeedsDisplay || LayoutNeeded)) {
-
+				
 				Clear ();
 				Clear ();
 				SetChildNeedsDisplay ();
 				SetChildNeedsDisplay ();
 			}
 			}
@@ -1541,8 +1539,8 @@ namespace Terminal.Gui {
 				if (TextFormatter != null) {
 				if (TextFormatter != null) {
 					TextFormatter.NeedsFormat = true;
 					TextFormatter.NeedsFormat = true;
 				}
 				}
-				TextFormatter?.Draw (ViewToScreen (boundsAdjustedForBorder), HasFocus ? ColorScheme.Focus : GetNormalColor (),
-				    HasFocus ? ColorScheme.HotFocus : Enabled ? ColorScheme.HotNormal : ColorScheme.Disabled,
+				TextFormatter?.Draw (ViewToScreen (Bounds), HasFocus ? GetFocusColor () : GetNormalColor (),
+				    HasFocus ? ColorScheme.HotFocus : GetHotNormalColor (),
 				    containerBounds);
 				    containerBounds);
 			}
 			}
 
 
@@ -1552,7 +1550,7 @@ namespace Terminal.Gui {
 			if (subviews != null) {
 			if (subviews != null) {
 				foreach (var view in subviews) {
 				foreach (var view in subviews) {
 					if (!view.NeedDisplay.IsEmpty || view.ChildNeedsDisplay || view.LayoutNeeded) {
 					if (!view.NeedDisplay.IsEmpty || view.ChildNeedsDisplay || view.LayoutNeeded) {
-						if (view.Frame.IntersectsWith (clipRect) && (view.Frame.IntersectsWith (boundsAdjustedForBorder) || boundsAdjustedForBorder.X < 0 || bounds.Y < 0)) {
+						if (view.Frame.IntersectsWith (clipRect) && (view.Frame.IntersectsWith (bounds) || bounds.X < 0 || bounds.Y < 0)) {
 							if (view.LayoutNeeded) {
 							if (view.LayoutNeeded) {
 								view.LayoutSubviews ();
 								view.LayoutSubviews ();
 							}
 							}
@@ -2268,12 +2266,12 @@ namespace Terminal.Gui {
 					}
 					}
 					newDimension = AutoSize && autosize > newDimension ? autosize : newDimension;
 					newDimension = AutoSize && autosize > newDimension ? autosize : newDimension;
 					break;
 					break;
-					
+
 				case Dim.DimFactor factor when !factor.IsFromRemaining ():
 				case Dim.DimFactor factor when !factor.IsFromRemaining ():
 					newDimension = d.Anchor (dimension);
 					newDimension = d.Anchor (dimension);
 					newDimension = AutoSize && autosize > newDimension ? autosize : newDimension;
 					newDimension = AutoSize && autosize > newDimension ? autosize : newDimension;
 					break;
 					break;
-					
+
 				case Dim.DimFill:
 				case Dim.DimFill:
 				default:
 				default:
 					newDimension = Math.Max (d.Anchor (dimension - location), 0);
 					newDimension = Math.Max (d.Anchor (dimension - location), 0);
@@ -2448,8 +2446,8 @@ namespace Terminal.Gui {
 			// return L (a topologically sorted order)
 			// return L (a topologically sorted order)
 			return result;
 			return result;
 		} // TopologicalSort
 		} // TopologicalSort
-		
-		
+
+
 		/// <summary>
 		/// <summary>
 		/// Invoked when a view starts executing or when the dimensions of the view have changed, for example in
 		/// Invoked when a view starts executing or when the dimensions of the view have changed, for example in
 		/// response to the container view or terminal resizing.
 		/// response to the container view or terminal resizing.