diff --git a/Terminal.Gui/Views/ComboBox.cs b/Terminal.Gui/Views/ComboBox.cs index 5463117ea..ee0a8fffb 100644 --- a/Terminal.Gui/Views/ComboBox.cs +++ b/Terminal.Gui/Views/ComboBox.cs @@ -69,6 +69,7 @@ namespace Terminal.Gui { readonly TextField search; readonly ListView listview; bool autoHide = true; + int minimumHeight = 2; /// /// Public constructor @@ -110,6 +111,10 @@ namespace Terminal.Gui { private void Initialize () { + if (Bounds.Height < minimumHeight && Height is Dim.DimAbsolute) { + Height = minimumHeight; + } + search.TextChanged += Search_Changed; listview.Y = Pos.Bottom (search); @@ -504,7 +509,7 @@ namespace Terminal.Gui { if (Bounds.Height == 0) return 0; - return Math.Min (Bounds.Height - 1, searchset?.Count > 0 ? searchset.Count : isShow ? Bounds.Height - 1 : 0); + return Math.Min (Math.Max(Bounds.Height - 1, minimumHeight - 1), searchset?.Count > 0 ? searchset.Count : isShow ? Math.Max (Bounds.Height - 1, minimumHeight - 1) : 0); } } } diff --git a/UICatalog/Scenarios/Unicode.cs b/UICatalog/Scenarios/Unicode.cs index d30a7a695..9ac674d42 100644 --- a/UICatalog/Scenarios/Unicode.cs +++ b/UICatalog/Scenarios/Unicode.cs @@ -63,20 +63,18 @@ namespace UICatalog { var checkBox = new CheckBox (gitString) { X = 20, Y = Pos.Y (label), Width = Dim.Percent (50) }; Win.Add (checkBox); - // BUGBUG: Combobox does not deal with unicode properly. -#if false label = new Label ("ComboBox:") { X = Pos.X (label), Y = Pos.Bottom (label) + 1 }; Win.Add (label); var comboBox = new ComboBox () { X = 20, Y = Pos.Y (label), - Width = Dim.Percent (50), + Width = Dim.Percent (50) }; comboBox.SetSource (new List () { gitString, "Со_хранить" }); Win.Add (comboBox); comboBox.Text = gitString; -#endif + label = new Label ("HexView:") { X = Pos.X (label), Y = Pos.Bottom (label) + 2 }; Win.Add (label); var hexView = new HexView (new System.IO.MemoryStream (Encoding.ASCII.GetBytes (gitString + " Со_хранить"))) {