From: Jiyun Yang Date: Mon, 30 Jan 2023 09:58:35 +0000 (+0900) Subject: [NUI] Fix NUI button not working when style disabled X-Git-Tag: accepted/tizen/unified/20231205.024657~472 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=687ab770358f09b6d2cfa31be5ff003ba08b01b1;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [NUI] Fix NUI button not working when style disabled There was a flag that prevent state updating while applying style. But the flag seemed to have a bug : when style is disabled, the state updating is never going to be done. This patch fixes the bug and changes the flag's name to be more contextual: styleApplied -> styleApplying. Signed-off-by: Jiyun Yang --- diff --git a/src/Tizen.NUI.Components/Controls/Button.Internal.cs b/src/Tizen.NUI.Components/Controls/Button.Internal.cs index 9db2270..b4815a2 100644 --- a/src/Tizen.NUI.Components/Controls/Button.Internal.cs +++ b/src/Tizen.NUI.Components/Controls/Button.Internal.cs @@ -34,7 +34,7 @@ namespace Tizen.NUI.Components private EventHandler stateChangeHandler; private bool isPressed = false; - private bool styleApplied = false; + private bool styleApplying = false; /// /// Gets accessibility name. @@ -193,7 +193,7 @@ namespace Tizen.NUI.Components [EditorBrowsable(EditorBrowsableState.Never)] protected void UpdateState() { - if (!styleApplied) return; + if (styleApplying) return; ControlState sourceState = ControlState; ControlState targetState; diff --git a/src/Tizen.NUI.Components/Controls/Button.cs b/src/Tizen.NUI.Components/Controls/Button.cs index 86bcef2..cc4bd78 100755 --- a/src/Tizen.NUI.Components/Controls/Button.cs +++ b/src/Tizen.NUI.Components/Controls/Button.cs @@ -1005,7 +1005,7 @@ namespace Tizen.NUI.Components { Debug.Assert(buttonIcon != null && buttonText != null); - styleApplied = false; + styleApplying = true; base.ApplyStyle(viewStyle); @@ -1041,7 +1041,7 @@ namespace Tizen.NUI.Components } } - styleApplied = true; + styleApplying = false; UpdateState(); }