Forráskód Böngészése

Wizard and Dialog fix. (#1803)

BDisp 3 éve
szülő
commit
10b410e406
2 módosított fájl, 23 hozzáadás és 7 törlés
  1. 16 0
      Terminal.Gui/Windows/Wizard.cs
  2. 7 7
      UICatalog/Scenarios/Dialogs.cs

+ 16 - 0
Terminal.Gui/Windows/Wizard.cs

@@ -103,6 +103,14 @@ namespace Terminal.Gui {
 					helpTextView.SetNeedsDisplay ();
 					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 += () => {
 				scrollBar.VisibleChanged += () => {
 					if (scrollBar.Visible && helpTextView.RightOffset == 0) {
 					if (scrollBar.Visible && helpTextView.RightOffset == 0) {
 						helpTextView.RightOffset = 1;
 						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) => {
 				helpTextView.DrawContent += (e) => {
 					scrollBar.Size = helpTextView.Lines;
 					scrollBar.Size = helpTextView.Lines;
 					scrollBar.Position = helpTextView.TopRow;
 					scrollBar.Position = helpTextView.TopRow;

+ 7 - 7
UICatalog/Scenarios/Dialogs.cs

@@ -174,13 +174,13 @@ namespace UICatalog.Scenarios {
 						};
 						};
 						buttons.Add (button);
 						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 
 					// This tests dynamically adding buttons; ensuring the dialog resizes if needed and 
 					// the buttons are laid out correctly
 					// the buttons are laid out correctly