[NUI] Fix ContentPage to calculate AppBar and Content size correctly
authorJaehyun Cho <jae_hyun.cho@samsung.com>
Mon, 18 Oct 2021 11:16:09 +0000 (20:16 +0900)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Tue, 9 Nov 2021 05:57:53 +0000 (14:57 +0900)
Previously, the size of AppBar and Content was set by setting Size2D
property.
This caused AppBar and Content to change their
Width/HeightSpecification.
Consequently, the size of AppBar and Content was not recalculated when
window size was changed.

Now, the size of AppBar and Content is set by SetSize() method.
Since SetSize() method does not change Width/HeightSpecification, the
size of AppBar and Content is recalculated correctly when window size is
changed.

src/Tizen.NUI.Components/Controls/Navigation/ContentPage.cs

index 2a0be89..3e81083 100755 (executable)
@@ -183,7 +183,7 @@ namespace Tizen.NUI.Components
                         appBarSizeH = Size2D.Height - Padding.Top - Padding.Bottom - appBar.Margin.Top - appBar.Margin.Bottom;
                     }
 
-                    appBar.Size2D = new Size2D(appBarSizeW, appBarSizeH);
+                    appBar.SetSize(new Size2D(appBarSizeW, appBarSizeH));
                 }
             }
 
@@ -209,7 +209,7 @@ namespace Tizen.NUI.Components
                         contentSizeH = Size2D.Height - Padding.Top - Padding.Bottom - content.Margin.Top - content.Margin.Bottom - (appBar?.Size2D.Height ?? 0);
                     }
 
-                    content.Size2D = new Size2D(contentSizeW, contentSizeH);
+                    content.SetSize(new Size2D(contentSizeW, contentSizeH));
                 }
             }
         }