From: Jaehyun Cho Date: Thu, 27 Oct 2022 10:41:34 +0000 (+0900) Subject: [NUI] Modify Menu to help customizing class X-Git-Tag: accepted/tizen/7.0/unified/20221103.165518~1^2~12 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=12665e3de049896204204d0da810d673c03f5529;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [NUI] Modify Menu to help customizing class To help application to customize Menu, Menu's size calculation should be modified not to set its size to its Content's size. --- diff --git a/src/Tizen.NUI.Components/Controls/Menu.cs b/src/Tizen.NUI.Components/Controls/Menu.cs index 351f5eb..d6ee226 100755 --- a/src/Tizen.NUI.Components/Controls/Menu.cs +++ b/src/Tizen.NUI.Components/Controls/Menu.cs @@ -528,26 +528,11 @@ namespace Tizen.NUI.Components private void CalculateSizeAndPosition() { - CalculateMenuSize(); - CalculateMenuPosition(); CalculateScrimPosition(); } - // Calculate menu's size based on content's size - private void CalculateMenuSize() - { - if (Content == null) - { - return; - } - if (Size.Equals(Content.Size) == false) - { - Size = new Size(Content.SizeWidth, Content.SizeHeight); - } - } - private View GetRootView() { View root = this; @@ -642,7 +627,11 @@ namespace Tizen.NUI.Components if (menuScreenPosX < 0) { menuScreenPosX = 0; - menuSizeW = Window.Size.Width; + + if (menuSizeW > Window.Size.Width) + { + menuSizeW = Window.Size.Width; + } } // Check if menu is not inside parent's boundary in y coordinate system. @@ -660,7 +649,11 @@ namespace Tizen.NUI.Components if (menuScreenPosY < 0) { menuScreenPosY = 0; - menuSizeH = Window.Size.Height; + + if (menuSizeH > Window.Size.Height) + { + menuSizeH = Window.Size.Height; + } } // Position is relative to parent's coordinate system.