Преглед на файлове

Revert "Add ability to disable AutoSize"

This reverts commit aa72a97cd677fa818d38ebb01268471479249a3b.
tznind преди 1 година
родител
ревизия
fadecc150a
променени са 4 файла, в които са добавени 3 реда и са изтрити 10 реда
  1. 0 7
      Terminal.Gui/View/Layout/ViewLayout.cs
  2. 1 1
      Terminal.Gui/Views/Button.cs
  3. 1 1
      Terminal.Gui/Views/CheckBox.cs
  4. 1 1
      Terminal.Gui/Views/Label.cs

+ 0 - 7
Terminal.Gui/View/Layout/ViewLayout.cs

@@ -35,13 +35,6 @@ public enum LayoutStyle
 
 public partial class View
 {
-    /// <summary>
-    /// Determines the default usage of <see cref="View.AutoSize"/> in views
-    /// that support it (e.g. <see cref="Button"/>.  Set to false if you frequently
-    /// get Exceptions about changing Width when AutoSize is true.
-    /// </summary>
-    public static bool DefaultAutoSize = true;
-
     #region Frame
 
     private Rectangle _frame;

+ 1 - 1
Terminal.Gui/Views/Button.cs

@@ -52,7 +52,7 @@ public class Button : View
         Height = 1;
 
         CanFocus = true;
-        AutoSize = View.DefaultAutoSize;
+        AutoSize = true;
         HighlightStyle |= HighlightStyle.Pressed;
 #if HOVER
         HighlightStyle |= HighlightStyle.Hover;

+ 1 - 1
Terminal.Gui/Views/CheckBox.cs

@@ -24,7 +24,7 @@ public class CheckBox : View
         Height = 1;
 
         CanFocus = true;
-        AutoSize = View.DefaultAutoSize;
+        AutoSize = true;
 
         // Things this view knows how to do
         AddCommand (Command.Accept, OnToggled);

+ 1 - 1
Terminal.Gui/Views/Label.cs

@@ -16,7 +16,7 @@ public class Label : View
     public Label ()
     {
         Height = 1;
-        AutoSize = View.DefaultAutoSize;
+        AutoSize = true;
 
         // Things this view knows how to do
         AddCommand (Command.HotKey, FocusNext);