Wizard and Dialog fix. (#1803)

This commit is contained in:
BDisp
2022-06-13 23:55:39 +01:00
committed by GitHub
parent 2e2566f0f0
commit 10b410e406
2 changed files with 23 additions and 7 deletions

View File

@@ -103,6 +103,14 @@ namespace Terminal.Gui {
helpTextView.SetNeedsDisplay ();
};
scrollBar.OtherScrollBarView.ChangedPosition += () => {
helpTextView.LeftColumn = scrollBar.OtherScrollBarView.Position;
if (helpTextView.LeftColumn != scrollBar.OtherScrollBarView.Position) {
scrollBar.OtherScrollBarView.Position = helpTextView.LeftColumn;
}
helpTextView.SetNeedsDisplay ();
};
scrollBar.VisibleChanged += () => {
if (scrollBar.Visible && helpTextView.RightOffset == 0) {
helpTextView.RightOffset = 1;
@@ -111,6 +119,14 @@ namespace Terminal.Gui {
}
};
scrollBar.OtherScrollBarView.VisibleChanged += () => {
if (scrollBar.OtherScrollBarView.Visible && helpTextView.BottomOffset == 0) {
helpTextView.BottomOffset = 1;
} else if (!scrollBar.OtherScrollBarView.Visible && helpTextView.BottomOffset == 1) {
helpTextView.BottomOffset = 0;
}
};
helpTextView.DrawContent += (e) => {
scrollBar.Size = helpTextView.Lines;
scrollBar.Position = helpTextView.TopRow;

View File

@@ -174,13 +174,13 @@ namespace UICatalog.Scenarios {
};
buttons.Add (button);
}
if (buttons.Count > 1) {
buttons [1].Text = "Accept";
buttons [1].IsDefault = true;
buttons [0].Visible = false;
buttons [0].Text = "_Back";
buttons [0].IsDefault = false;
}
//if (buttons.Count > 1) {
// buttons [1].Text = "Accept";
// buttons [1].IsDefault = true;
// buttons [0].Visible = false;
// buttons [0].Text = "_Back";
// buttons [0].IsDefault = false;
//}
// This tests dynamically adding buttons; ensuring the dialog resizes if needed and
// the buttons are laid out correctly