2
0
Эх сурвалжийг харах

Addded comments to remind myself of issues

Tig 1 жил өмнө
parent
commit
f51ec9cf66

+ 1 - 0
Terminal.Gui/View/Layout/ViewLayout.cs

@@ -794,6 +794,7 @@ public partial class View
 
     private void LayoutSubview (View v, Size contentSize)
     {
+        // BUGBUG: Calling SetRelativeLayout before LayoutSubviews is problematic. Need to resolve.
         v.SetRelativeLayout (contentSize);
         v.LayoutSubviews ();
         v.LayoutNeeded = false;

+ 7 - 0
Terminal.Gui/Views/Slider.cs

@@ -265,6 +265,13 @@ public class Slider<T> : View
 
         Enter += (s, e) => { };
 
+        // BUGBUG: This should not be needed - Need to ensure SetRelativeLayout gets called during EndInit
+        Initialized += (s, e) =>
+                         {
+                             CalcSpacingConfig ();
+                             SetContentSizeBestFit ();
+                         };
+
         LayoutStarted += (s, e) =>
                           {
                               CalcSpacingConfig ();

+ 1 - 1
UICatalog/Scenarios/ContentScrolling.cs

@@ -27,7 +27,7 @@ public class ContentScrolling : Scenario
             BorderStyle = LineStyle.Rounded;
             Arrangement = ViewArrangement.Fixed;
 
-            ContentSize = new (10, 40);
+            ContentSize = new (60, 40);
             ViewportSettings |= ViewportSettings.ClearContentOnly;
             ViewportSettings |= ViewportSettings.ClipContentOnly;
 

+ 2 - 1
UnitTests/Views/SliderTests.cs

@@ -508,8 +508,9 @@ public class SliderTests
         view.BeginInit ();
         view.EndInit ();
 
+        // BUGBUG: This should not be needed. EndInit should have called LayoutSubviews
+        // BUGBUG: and LayoutSubviews should have 
         view.LayoutSubviews ();
-        slider.SetRelativeLayout(view.Viewport.Size);
 
         Size expectedSize = slider.Frame.Size;