|
@@ -70,16 +70,18 @@ public class Wizard : Dialog
|
|
ButtonAlignmentModes |= AlignmentModes.IgnoreFirstOrLast;
|
|
ButtonAlignmentModes |= AlignmentModes.IgnoreFirstOrLast;
|
|
BorderStyle = LineStyle.Double;
|
|
BorderStyle = LineStyle.Double;
|
|
|
|
|
|
|
|
+ BackButton = new () { Text = Strings.wzBack };
|
|
|
|
+ NextFinishButton = new ()
|
|
|
|
+ {
|
|
|
|
+ Text = Strings.wzFinish,
|
|
|
|
+ IsDefault = true
|
|
|
|
+ };
|
|
|
|
+
|
|
//// Add a horiz separator
|
|
//// Add a horiz separator
|
|
- var separator = new LineView (Orientation.Horizontal) { Y = Pos.AnchorEnd (2) };
|
|
|
|
- Add (separator);
|
|
|
|
|
|
+ var separator = new LineView (Orientation.Horizontal) { Y = Pos.Top (BackButton) - 1 };
|
|
|
|
|
|
- // BUGBUG: Space is to work around https://github.com/gui-cs/Terminal.Gui/issues/1812
|
|
|
|
- BackButton = new () { Text = Strings.wzBack };
|
|
|
|
|
|
+ Add (separator);
|
|
AddButton (BackButton);
|
|
AddButton (BackButton);
|
|
-
|
|
|
|
- NextFinishButton = new () { Text = Strings.wzFinish };
|
|
|
|
- NextFinishButton.IsDefault = true;
|
|
|
|
AddButton (NextFinishButton);
|
|
AddButton (NextFinishButton);
|
|
|
|
|
|
BackButton.Accept += BackBtn_Clicked;
|
|
BackButton.Accept += BackBtn_Clicked;
|
|
@@ -495,14 +497,14 @@ public class Wizard : Dialog
|
|
// If we're modal, then we expand the WizardStep so that the top and side
|
|
// If we're modal, then we expand the WizardStep so that the top and side
|
|
// borders and not visible. The bottom border is the separator above the buttons.
|
|
// borders and not visible. The bottom border is the separator above the buttons.
|
|
step.X = step.Y = 0;
|
|
step.X = step.Y = 0;
|
|
- step.Height = Dim.Fill (2); // for button frame
|
|
|
|
|
|
+ step.Height = Dim.Fill (Dim.Func (() => IsInitialized ? Subviews.First (view => view.Y.Has<PosAnchorEnd> (out _)).Frame.Height + 1 : 1)); // for button frame (+1 for lineView)
|
|
step.Width = Dim.Fill ();
|
|
step.Width = Dim.Fill ();
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
// If we're not a modal, then we show the border around the WizardStep
|
|
// If we're not a modal, then we show the border around the WizardStep
|
|
step.X = step.Y = 0;
|
|
step.X = step.Y = 0;
|
|
- step.Height = Dim.Fill (1); // for button frame
|
|
|
|
|
|
+ step.Height = Dim.Fill (Dim.Func (() => IsInitialized ? Subviews.First (view => view.Y.Has<PosAnchorEnd> (out _)).Frame.Height + 1 : 2)); // for button frame (+1 for lineView)
|
|
step.Width = Dim.Fill ();
|
|
step.Width = Dim.Fill ();
|
|
}
|
|
}
|
|
}
|
|
}
|