diff --git a/Terminal.Gui/Views/ComboBox.cs b/Terminal.Gui/Views/ComboBox.cs index 6fa45e276..886fb2b7e 100644 --- a/Terminal.Gui/Views/ComboBox.cs +++ b/Terminal.Gui/Views/ComboBox.cs @@ -810,7 +810,7 @@ public class ComboBox : View, IDesignable return true; } - private class ComboListView : ListView + internal class ComboListView : ListView { private ComboBox _container; private bool _hideDropdownListOnClick; diff --git a/Tests/UnitTests/Views/ComboBoxTests.cs b/Tests/UnitTests/Views/ComboBoxTests.cs index a8caab2c7..1efabd970 100644 --- a/Tests/UnitTests/Views/ComboBoxTests.cs +++ b/Tests/UnitTests/Views/ComboBoxTests.cs @@ -525,9 +525,21 @@ public class ComboBoxTests (ITestOutputHelper output) Assert.True (cb.IsShow); Assert.Equal (-1, cb.SelectedItem); Assert.Equal ("", cb.Text); + + Assert.Equal ("Default", ThemeManager.Theme); Assert.False (Application.ClearScreenNextIteration); + Assert.True (cb.HasFocus); Assert.True (cb.NeedsLayout); Assert.True (cb.NeedsDraw); + var tf = cb.SubViews.ElementAt (0) as TextField; + Assert.False (tf!.HasFocus); + Assert.True (tf.NeedsLayout); + Assert.True (tf.NeedsDraw); + var clv = cb.SubViews.ElementAt (1) as ComboBox.ComboListView; + Assert.True (clv!.HasFocus); + Assert.True (clv.NeedsLayout); + Assert.True (clv.NeedsDraw); + cb.Layout (); cb.Draw (); @@ -544,13 +556,13 @@ Three ", Attribute [] attributes = { // 0 - cb.SubViews.ElementAt (0).GetAttributeForRole(VisualRole.Focus), + tf.GetAttributeForRole(VisualRole.Focus), // 1 - cb.SubViews.ElementAt(1).GetAttributeForRole(VisualRole.HotFocus), + clv.GetAttributeForRole(VisualRole.HotFocus), // 2 - cb.SubViews.ElementAt(1).GetAttributeForRole(VisualRole.Normal) + clv.GetAttributeForRole(VisualRole.Normal) }; DriverAssert.AssertDriverAttributesAre (