Closes #973. ScrollView and TextField fixes.

This commit is contained in:
BDisp
2020-10-27 17:14:52 +00:00
parent 1e656b32c5
commit 0fc29ada9f
2 changed files with 11 additions and 4 deletions

View File

@@ -27,7 +27,7 @@ type Box10x (x: int, y: int) =
raise (NotImplementedException())
override this.Redraw (_: Rect) =
Application.Driver.SetAttribute Application.Current.ColorScheme.Focus
Application.Driver.SetAttribute this.ColorScheme.Focus
do
let mutable y = 0
while y < h do
@@ -47,7 +47,7 @@ type Filler (rect: Rect) =
new Filler ()
override this.Redraw (_: Rect) =
Application.Driver.SetAttribute Application.Current.ColorScheme.Focus
Application.Driver.SetAttribute this.ColorScheme.Focus
let mutable f = this.Frame
do
let mutable y = 0

View File

@@ -48,13 +48,13 @@ namespace Terminal.Gui {
/// <param name="text">Initial text contents.</param>
public TextField (string text) : this (ustring.Make (text))
{
Height = 1;
Initialize ();
}
/// <summary>
/// Initializes a new instance of the <see cref="TextField"/> class using <see cref="LayoutStyle.Computed"/> positioning.
/// </summary>
public TextField () : this (string.Empty) { }
public TextField () : this (string.Empty) { Initialize (); }
/// <summary>
/// Initializes a new instance of the <see cref="TextField"/> class using <see cref="LayoutStyle.Computed"/> positioning.
@@ -80,6 +80,8 @@ namespace Terminal.Gui {
void Initialize (ustring text, int w)
{
Initialize ();
if (text == null)
text = "";
@@ -91,6 +93,11 @@ namespace Terminal.Gui {
WantMousePositionReports = true;
}
void Initialize ()
{
Height = 1;
}
///<inheritdoc/>
public override bool OnLeave (View view)
{