[NUI] Remove logic that prevent theme changing overwrite user set properties (#2969)
authorJiyun Yang <ji.yang@samsung.com>
Wed, 28 Apr 2021 11:43:14 +0000 (20:43 +0900)
committerGitHub <noreply@github.com>
Wed, 28 Apr 2021 11:43:14 +0000 (20:43 +0900)
Signed-off-by: Jiyun Yang <ji.yang@samsung.com>
src/Tizen.NUI/src/public/BaseComponents/View.cs
src/Tizen.NUI/src/public/BaseComponents/ViewInternal.cs

index e340ba6..165d04b 100755 (executable)
@@ -2675,16 +2675,6 @@ namespace Tizen.NUI.BaseComponents
             UpdateStyle();
         }
 
-        private bool IsViewPropertyDirty(BindableProperty styleProperty)
-        {
-            if (dirtyPropertySet.Count == 0)
-            {
-                return false;
-            }
-
-            return dirtyPropertySet.Contains(styleProperty.PropertyName);
-        }
-
         /// <summary>
         /// Apply style instance to the view.
         /// Basically it sets the bindable property to the value of the bindable property with same name in the style.
@@ -2702,11 +2692,6 @@ namespace Tizen.NUI.BaseComponents
                 return;
             }
 
-            if (dirtyPropertySet == null)
-            {
-                dirtyPropertySet = new HashSet<string>();
-            }
-
             BindableProperty.GetBindablePropertysOfType(GetType(), out var bindablePropertyOfView);
 
             if (bindablePropertyOfView == null)
@@ -2719,12 +2704,6 @@ namespace Tizen.NUI.BaseComponents
 
             foreach (var sourceProperty in dirtyStyleProperties)
             {
-                if (blockSetDirty && IsViewPropertyDirty(sourceProperty))
-                {
-                    // Skip applying theme style for a property set by user.
-                    continue;
-                }
-
                 var sourceValue = viewStyle.GetValue(sourceProperty);
 
                 if (sourceValue == null)
index 53acc0e..8245bcd 100755 (executable)
@@ -28,9 +28,7 @@ namespace Tizen.NUI.BaseComponents
     /// <since_tizen> 3 </since_tizen>
     public partial class View
     {
-        private static bool blockSetDirty = false;
         private ViewSelectorData selectorData;
-        private HashSet<string> dirtyPropertySet;
 
         internal string styleName;
 
@@ -1172,21 +1170,6 @@ namespace Tizen.NUI.BaseComponents
             return false;
         }
 
-        /// <summary>
-        /// Call this method from a child class to notify that a change happened on a property.
-        /// </summary>
-        /// <param name="propertyName">The name of the property that changed.</param>
-        [EditorBrowsable(EditorBrowsableState.Never)]
-        protected override void OnPropertyChanged([CallerMemberName] string propertyName = null)
-        {
-            base.OnPropertyChanged(propertyName);
-
-            if (!blockSetDirty)
-            {
-                dirtyPropertySet?.Add(propertyName);
-            }
-        }
-
         private void DisConnectFromSignals()
         {
             // Save current CPtr.
@@ -1397,9 +1380,7 @@ namespace Tizen.NUI.BaseComponents
 
             if (newStyle != null)
             {
-                blockSetDirty = true;
                 ApplyStyle(newStyle);
-                blockSetDirty = false;
             }
         }