From 89e1db3664a0abd92010544907bb82ce586b24cc Mon Sep 17 00:00:00 2001 From: Tig Date: Fri, 3 May 2024 13:04:34 -0600 Subject: [PATCH] Removed AutoSize from MessageBox --- Terminal.Gui/Views/DatePicker.cs | 2 -- Terminal.Gui/Views/MessageBox.cs | 3 +-- Terminal.Gui/Views/Wizard/Wizard.cs | 10 +++++----- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/Terminal.Gui/Views/DatePicker.cs b/Terminal.Gui/Views/DatePicker.cs index 1b4c4c841..075c9f890 100644 --- a/Terminal.Gui/Views/DatePicker.cs +++ b/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, diff --git a/Terminal.Gui/Views/MessageBox.cs b/Terminal.Gui/Views/MessageBox.cs index 8689a9f11..35bad7817 100644 --- a/Terminal.Gui/Views/MessageBox.cs +++ b/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); diff --git a/Terminal.Gui/Views/Wizard/Wizard.cs b/Terminal.Gui/Views/Wizard/Wizard.cs index c3691b3e1..deb2c1f33 100644 --- a/Terminal.Gui/Views/Wizard/Wizard.cs +++ b/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; } }