Browse Source

Reenabled PositionTopLevel and fixed bug in TextField

Tig Kindel 1 year ago
parent
commit
e3ad40a6fa

+ 2 - 1
Terminal.Gui/Views/TextField.cs

@@ -1753,6 +1753,7 @@ public class TextField : View
         }
     }
 
+    // BUGBUG: This assumes Frame == Bounds. It's also not clear what the intention is. For now, changed to always return 0.
     private int OffSetBackground ()
     {
         var offB = 0;
@@ -1762,7 +1763,7 @@ public class TextField : View
             offB = SuperView.Frame.Right - Frame.Right - 1;
         }
 
-        return offB;
+        return 0;//offB;
     }
 
     private int PositionCursor (MouseEvent ev)

+ 0 - 1
Terminal.Gui/Views/Toplevel.cs

@@ -379,7 +379,6 @@ public partial class Toplevel : View
     /// <param name="top">The Toplevel to adjust.</param>
     public virtual void PositionToplevel (Toplevel top)
     {
-        return;
         View superView = GetLocationThatFits (
                                               top,
                                               top.Frame.X,

+ 3 - 3
UnitTests/View/Adornment/MarginTests.cs

@@ -36,9 +36,9 @@ public class MarginTests
 
         TestHelpers.AssertDriverContentsAre (
                                              @"
-LTR
-L R
-BBB",
+MMM
+M M
+MMM",
                                              _output
                                             );
         TestHelpers.AssertDriverAttributesAre ("0", null, superView.GetNormalColor ());

+ 3 - 3
UnitTests/View/Adornment/PaddingTests.cs

@@ -31,9 +31,9 @@ public class PaddingTests
 
         TestHelpers.AssertDriverContentsAre (
                                              @"
-LTR
-L R
-BBB",
+PPP
+P P
+PPP",
                                              _output
                                             );
         TestHelpers.AssertDriverAttributesAre ("0", null, view.GetNormalColor ());