فهرست منبع

TextField modernization

Tig 1 سال پیش
والد
کامیت
f0865e8ff4
1فایلهای تغییر یافته به همراه1 افزوده شده و 12 حذف شده
  1. 1 12
      Terminal.Gui/Views/TextField.cs

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

@@ -33,7 +33,7 @@ public class TextField : View
         CaptionColor = new Color (Color.DarkGray);
         ReadOnly = false;
         Autocomplete = new TextFieldAutocomplete ();
-        Height = 1; // BUGBUG: This should either be Dim.Auto or we should enforce ContentSize.Height = 1
+        Height = Dim.Auto (DimAutoStyle.Text, minimumContentDim: 1);
 
         CanFocus = true;
         CursorVisibility = CursorVisibility.Default;
@@ -44,8 +44,6 @@ public class TextField : View
 
         Initialized += TextField_Initialized;
 
-        LayoutComplete += TextField_LayoutComplete;
-
         // Things this view knows how to do
         AddCommand (
                     Command.DeleteCharRight,
@@ -1858,15 +1856,6 @@ public class TextField : View
         Autocomplete.HostControl = this;
         Autocomplete.PopupInsideContainer = false;
     }
-
-    private void TextField_LayoutComplete (object sender, LayoutEventArgs e)
-    {
-        // Don't let height > 1
-        if (Frame.Height > 1)
-        {
-            Height = 1; // BUGBUG: Views should avoid setting Height as doing so implies Frame.Size == ContentSize
-        }
-    }
 }
 
 /// <summary>