[NUI] Fix to update Scrollbar when ScrollableBase size changes
authorJaehyun Cho <jae_hyun.cho@samsung.com>
Tue, 28 Sep 2021 07:50:40 +0000 (16:50 +0900)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Tue, 9 Nov 2021 05:57:53 +0000 (14:57 +0900)
Previously, if ScrollableBase size changed, Scrollbar was not updated.
So some children was not displayed when ScrollableBase size changed.

Now, when ScrollableBase size changes, Scrollbar is updated in the
ScrollableBase's Relayout callback.
So all children are displayed correctly when ScrollableBase size changes.

src/Tizen.NUI.Components/Controls/ScrollableBase.cs

index 25fd34c..98078bf 100755 (executable)
@@ -645,10 +645,13 @@ namespace Tizen.NUI.Components
                 WidthSpecification = ScrollingDirection == Direction.Vertical ? LayoutParamPolicies.MatchParent : LayoutParamPolicies.WrapContent,
                 HeightSpecification = ScrollingDirection == Direction.Vertical ? LayoutParamPolicies.WrapContent : LayoutParamPolicies.MatchParent,
             };
+            // Check if children's sizes change to update Scrollbar
             ContentContainer.Relayout += OnScrollingChildRelayout;
             propertyNotification = ContentContainer.AddPropertyNotification("position", PropertyCondition.Step(mScrollingEventThreshold));
             propertyNotification.Notified += OnPropertyChanged;
             base.Add(ContentContainer);
+            // Check if ScrollableBase's size changes to update Scrollbar
+            base.Relayout += OnScrollingChildRelayout;
 
             Scrollbar = new Scrollbar();