瀏覽代碼

Removed AutoSize from MessageBox

Tig 1 年之前
父節點
當前提交
89e1db3664
共有 3 個文件被更改,包括 6 次插入9 次删除
  1. 0 2
      Terminal.Gui/Views/DatePicker.cs
  2. 1 2
      Terminal.Gui/Views/MessageBox.cs
  3. 5 5
      Terminal.Gui/Views/Wizard/Wizard.cs

+ 0 - 2
Terminal.Gui/Views/DatePicker.cs

@@ -214,7 +214,6 @@ public class DatePicker : View
 
         _previousMonthButton = new Button
         {
-            AutoSize = false,
             X = Pos.Center () - 2,
             Y = Pos.Bottom (_calendar) - 1,
             Height = 1,
@@ -234,7 +233,6 @@ public class DatePicker : View
 
         _nextMonthButton = new Button
         {
-            AutoSize = false,
             X = Pos.Right (_previousMonthButton) + 2,
             Y = Pos.Bottom (_calendar) - 1,
             Height = 1,

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

@@ -369,14 +369,13 @@ public static class MessageBox
 
         var messageLabel = new Label
         {
-            AutoSize = !wrapMessage,
             Text = message,
             TextAlignment = TextAlignment.Centered,
             X = Pos.Center (),
             Y = 0
         };
 
-        if (!messageLabel.AutoSize)
+        if (!wrapMessage)
         {
             messageLabel.Width = Dim.Fill ();
             messageLabel.Height = Dim.Fill (1);

+ 5 - 5
Terminal.Gui/Views/Wizard/Wizard.cs

@@ -93,10 +93,10 @@ public class Wizard : Dialog
         Add (separator);
 
         // BUGBUG: Space is to work around https://github.com/gui-cs/Terminal.Gui/issues/1812
-        BackButton = new Button { AutoSize = true, Text = Strings.wzBack };
+        BackButton = new () { Text = Strings.wzBack };
         AddButton (BackButton);
 
-        NextFinishButton = new Button { AutoSize = true, Text = Strings.wzFinish };
+        NextFinishButton = new () { Text = Strings.wzFinish };
         NextFinishButton.IsDefault = true;
         AddButton (NextFinishButton);
 
@@ -417,10 +417,10 @@ public class Wizard : Dialog
         {
             if (key == Key.Esc)
             {
-                    var args = new WizardButtonEventArgs ();
-                    Cancelled?.Invoke (this, args);
+                var args = new WizardButtonEventArgs ();
+                Cancelled?.Invoke (this, args);
 
-                    return false;
+                return false;
             }
         }