Revert "[NUI] Refactoring Theme and StyleManager (#1981)" (#2013)
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI.Components / Controls / Popup.cs
index f0ffc67..9a44d4a 100755 (executable)
@@ -357,14 +357,7 @@ namespace Tizen.NUI.Components
             {
                 if (null == titleText)
                 {
-                    titleText = new TextLabel
-                    {
-                        PositionUsesPivotPoint = true,
-                        ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft,
-                        PivotPoint = Tizen.NUI.PivotPoint.TopLeft,
-                        HorizontalAlignment = HorizontalAlignment.Begin,
-                        VerticalAlignment = VerticalAlignment.Bottom
-                    };
+                    titleText = new TextLabel();
                     Add(titleText);
                 }
                 return titleText;
@@ -750,12 +743,6 @@ namespace Tizen.NUI.Components
             PopupStyle ppStyle = viewStyle as PopupStyle;
             if (null != ppStyle)
             {
-                if (ppStyle.Buttons != null)
-                {
-                    if (ppStyle.Buttons.PositionUsesPivotPoint == null) ppStyle.Buttons.PositionUsesPivotPoint = true;
-                    if (ppStyle.Buttons.ParentOrigin == null) ppStyle.Buttons.ParentOrigin = Tizen.NUI.ParentOrigin.BottomLeft;
-                    if (ppStyle.Buttons.PivotPoint == null) ppStyle.Buttons.PivotPoint = Tizen.NUI.PivotPoint.BottomLeft;
-                }
                 Title.ApplyStyle(ppStyle.Title);
                 Title.RaiseToTop();
             }
@@ -771,12 +758,20 @@ namespace Tizen.NUI.Components
             return new PopupStyle();
         }
 
-        /// <inheritdoc/>
+        /// <summary>
+        /// Theme change callback when theme is changed, this callback will be trigger.
+        /// </summary>
+        /// <param name="sender">The sender</param>
+        /// <param name="e">The event data</param>
         [EditorBrowsable(EditorBrowsableState.Never)]
-        protected override void OnUpdate()
+        protected override void OnThemeChangedEvent(object sender, StyleManager.ThemeChangeEventArgs e)
         {
-            base.OnUpdate();
-            UpdateView();
+            PopupStyle ppStyle = StyleManager.Instance.GetViewStyle(StyleName) as PopupStyle;
+            if (ppStyle != null)
+            {
+                ApplyStyle(ppStyle);
+                UpdateView();
+            }
         }
 
         private void Initialize()
@@ -804,7 +799,6 @@ namespace Tizen.NUI.Components
 
         private void UpdateView()
         {
-            if (popupStyle == null) return;
             btGroup.UpdateButton(popupStyle.Buttons);
             UpdateContentView();
             UpdateTitle();