From: Seoyeon Kim Date: Tue, 10 May 2022 06:38:13 +0000 (+0900) Subject: [NUI] Fix ThumbColor property to change its own color X-Git-Tag: accepted/tizen/unified/20231205.024657~957 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=938d2f6229d588873d468a5c32122ca399dc4fef;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [NUI] Fix ThumbColor property to change its own color - Currently, when the user sets ThumbColor, the background color of thumb is changed. - Fixed to change the thumb color itself, not the background color. Signed-off-by: Seoyeon Kim --- diff --git a/src/Tizen.NUI.Components/Controls/Slider.cs b/src/Tizen.NUI.Components/Controls/Slider.cs index 5c88e1b..d428b21 100755 --- a/src/Tizen.NUI.Components/Controls/Slider.cs +++ b/src/Tizen.NUI.Components/Controls/Slider.cs @@ -613,14 +613,40 @@ namespace Tizen.NUI.Components { get { - return thumbImage?.Color; + return thumbColor; } set { if (null != thumbImage) { - thumbImage.BackgroundColor = value; thumbColor = value; + + if (thumbImage.ResourceUrl != null) + { + thumbImage.ResourceUrl = null; + } + + using (PropertyMap map = new PropertyMap()) + { + // To remove CA2000 warning messages, use `using` statement. + using (PropertyValue type = new PropertyValue((int)Visual.Type.Color)) + { + map.Insert((int)Visual.Property.Type, type); + } + using (PropertyValue color = new PropertyValue(thumbColor)) + { + map.Insert((int)ColorVisualProperty.MixColor, color); + } + using (PropertyValue radius = new PropertyValue(0.5f)) + { + map.Insert((int)Visual.Property.CornerRadius, radius); + } + using (PropertyValue policyType = new PropertyValue((int)VisualTransformPolicyType.Relative)) + { + map.Insert((int)Visual.Property.CornerRadiusPolicy, policyType); + } + thumbImage.Image = map; + } } } }