Merge branch 'dialog_justify_buttons' into wizard

This commit is contained in:
Charlie Kindel
2022-06-11 03:06:38 -07:00
3 changed files with 12 additions and 6 deletions

View File

@@ -141,11 +141,14 @@ namespace Terminal.Gui {
/// </summary>
Right
}
private ButtonAlignments buttonAlignment = Dialog.ButtonAlignments.Center;
/// <summary>
/// Determines how the <see cref="Dialog"/> <see cref="Button"/>s are aligned along the
/// bottom of the dialog.
/// </summary>
public ButtonAlignments ButtonAlignment = Dialog.ButtonAlignments.Center;
public ButtonAlignments ButtonAlignment { get => buttonAlignment; set => buttonAlignment = value; }
void LayoutStartedHandler ()
{

View File

@@ -148,9 +148,12 @@ namespace UICatalog.Scenarios {
};
showDialogButton.Clicked += () => {
try {
int width = int.Parse (widthEdit.Text.ToString ());
int height = int.Parse (heightEdit.Text.ToString ());
int numButtons = int.Parse (numButtonsEdit.Text.ToString ());
int width = 0;
int.TryParse (widthEdit.Text.ToString (), out width);
int height = 0;
int.TryParse (heightEdit.Text.ToString (), out height);
int numButtons = 3;
int.TryParse (numButtonsEdit.Text.ToString (), out numButtons);
var buttons = new List<Button> ();
var clicked = -1;

View File

@@ -576,7 +576,7 @@ namespace Terminal.Gui.ConsoleDrivers {
││ Hello World │ │
││ │ │
││ │ │
││ [ Ok ] │ │
││ [ Ok ] │ │
│└───────────────┘ │
└──────────────────┘
";
@@ -593,7 +593,7 @@ namespace Terminal.Gui.ConsoleDrivers {
││ Hello World │ │
││ │ │
││ │ │
││ [ Ok ] │ │
││ [ Ok ] │ │
│└───────────────┘ │
└──────────────────┘
";