From d0e07c2698dd58ead83ed5c0f373feb49885975a Mon Sep 17 00:00:00 2001 From: Jiyun Yang Date: Wed, 28 Apr 2021 20:43:14 +0900 Subject: [PATCH] [NUI] Remove logic that prevent theme changing overwrite user set properties (#2969) Signed-off-by: Jiyun Yang --- src/Tizen.NUI/src/public/BaseComponents/View.cs | 21 --------------------- .../src/public/BaseComponents/ViewInternal.cs | 19 ------------------- 2 files changed, 40 deletions(-) diff --git a/src/Tizen.NUI/src/public/BaseComponents/View.cs b/src/Tizen.NUI/src/public/BaseComponents/View.cs index e340ba6..165d04b 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/View.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/View.cs @@ -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); - } - /// /// 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(); - } - 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) diff --git a/src/Tizen.NUI/src/public/BaseComponents/ViewInternal.cs b/src/Tizen.NUI/src/public/BaseComponents/ViewInternal.cs index 53acc0e..8245bcd 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/ViewInternal.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/ViewInternal.cs @@ -28,9 +28,7 @@ namespace Tizen.NUI.BaseComponents /// 3 public partial class View { - private static bool blockSetDirty = false; private ViewSelectorData selectorData; - private HashSet dirtyPropertySet; internal string styleName; @@ -1172,21 +1170,6 @@ namespace Tizen.NUI.BaseComponents return false; } - /// - /// Call this method from a child class to notify that a change happened on a property. - /// - /// The name of the property that changed. - [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; } } -- 2.7.4