Browse Source

fixed ListView test wrt AllowNegativeXWhenWidthGreaterThanContentWidth

Tig 8 months ago
parent
commit
5c2035d894
2 changed files with 6 additions and 3 deletions
  1. 4 1
      UICatalog/Scenarios/ListViewWithSelection.cs
  2. 2 2
      UnitTests/Views/ListViewTests.cs

+ 4 - 1
UICatalog/Scenarios/ListViewWithSelection.cs

@@ -80,7 +80,9 @@ public class ListViewWithSelection : Scenario
             Width = Dim.Func (() => _listView?.MaxLength ?? 10),
             Height = Dim.Fill (),
             AllowsMarking = false,
-            AllowsMultipleSelection = false
+            AllowsMultipleSelection = false,
+            BorderStyle = LineStyle.Dotted,
+            Arrangement = ViewArrangement.Resizable
         };
         _listView.RowRender += ListView_RowRender;
         _appWindow.Add (_listView);
@@ -106,6 +108,7 @@ public class ListViewWithSelection : Scenario
         _listView.Accepting += (s, a) => LogEvent (s as View, a, "Accept");
         _listView.Selecting += (s, a) => LogEvent (s as View, a, "Select");
         _listView.VerticalScrollBar.AutoShow = true;
+        _listView.HorizontalScrollBar.AutoShow = true;
 
         bool? LogEvent (View sender, EventArgs args, string message)
         {

+ 2 - 2
UnitTests/Views/ListViewTests.cs

@@ -790,10 +790,10 @@ Item 6",
         var lv = new ListView
         {
             X = 1,
-            Width = 10,
-            Height = 5,
             Source = new ListWrapper<string> (source)
         };
+        lv.Height = lv.Source.Count;
+        lv.Width = lv.MaxLength;
         var top = new Toplevel ();
         top.Add (lv);
         Application.Begin (top);