[NUI] Fix Menu's BackgroundColor
authorJaehyun Cho <jae_hyun.cho@samsung.com>
Thu, 15 Jul 2021 00:49:53 +0000 (09:49 +0900)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Mon, 19 Jul 2021 09:01:03 +0000 (18:01 +0900)
Menu covers the window size to dismiss Menu when outside of Menu is touched.

Therefore, Menu's BackgroundColor should be transparent and Menu Content's
BackgroundColor should be set instead.

src/Tizen.NUI.Components/Controls/Menu.cs
src/Tizen.NUI.Components/Theme/DefaultThemeCommon.cs

index 2647c02..323ef32 100755 (executable)
@@ -387,6 +387,8 @@ namespace Tizen.NUI.Components
             WidthSpecification = LayoutParamPolicies.WrapContent;
             HeightSpecification = LayoutParamPolicies.WrapContent;
 
+            BackgroundColor = Color.Transparent;
+
             // Menu is added to Anchor so Menu should exclude layouting because
             // if Anchor has Layout, then Menu is displayed at an incorrect position.
             ExcludeLayouting = true;
@@ -412,6 +414,9 @@ namespace Tizen.NUI.Components
                 ScrollingDirection = ScrollableBase.Direction.Vertical,
                 ScrollEnabled = true,
                 HideScrollbar = false,
+
+                // FIXME: This color should be in DefaultThemeCommon.cs.
+                BackgroundColor = new Color("#EEEFF1"),
             };
         }
 
index 9f0ec4c..9f62aa8 100755 (executable)
@@ -682,12 +682,6 @@ namespace Tizen.NUI.Components
                 }
             });
 
-            // Menu base style
-            theme.AddStyleWithoutClone("Tizen.NUI.Components.Menu", new ViewStyle()
-            {
-                BackgroundColor = new Color("#EEEFF1"),
-            });
-
             // MenuItem base style
             theme.AddStyleWithoutClone("Tizen.NUI.Components.MenuItem", new ButtonStyle()
             {