Selaa lähdekoodia

Removed AutoSize from MessageBox

Tig 1 vuosi sitten
vanhempi
commit
89e1db3664

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

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

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

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

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

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