[NUI] Change some properties of Struct to nullable
authorBowon Ryu <bowon.ryu@samsung.com>
Wed, 11 Aug 2021 09:45:52 +0000 (18:45 +0900)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Wed, 18 Aug 2021 03:10:44 +0000 (12:10 +0900)
Some properties in the PropertyMap have default values (set when null).
In this case, user can use the default value implemented in DALi
by changing the property to nullable.

Signed-off-by: Bowon Ryu <bowon.ryu@samsung.com>
src/Tizen.NUI/src/public/BaseComponents/TextUtils.cs
src/Tizen.NUI/src/public/Common/NUIConstants.cs

index c5d3582..dae3f06 100755 (executable)
@@ -1379,11 +1379,13 @@ namespace Tizen.NUI.BaseComponents
         {
             var map = new PropertyMap();
 
+            map.Add("enable", new PropertyValue(underline.Enable));
+
             if (underline.Color != null)
                 map.Add("color", new PropertyValue(underline.Color));
 
-            map.Add("enable", new PropertyValue(underline.Enable));
-            map.Add("height", new PropertyValue(underline.Height));
+            if (underline.Height != null)
+                map.Add("height", new PropertyValue((float)underline.Height));
 
             return map;
         }
@@ -1427,7 +1429,8 @@ namespace Tizen.NUI.BaseComponents
             if (shadow.Color != null)
                 map.Add("color", new PropertyValue(shadow.Color));
 
-            map.Add("blurRadius", new PropertyValue(shadow.BlurRadius));
+            if (shadow.BlurRadius != null)
+                map.Add("blurRadius", new PropertyValue((float)shadow.BlurRadius));
 
             return map;
         }
@@ -1469,7 +1472,8 @@ namespace Tizen.NUI.BaseComponents
             if (outline.Color != null)
                 map.Add("color", new PropertyValue(outline.Color));
 
-            map.Add("width", new PropertyValue(outline.Width));
+            if (outline.Width != null)
+                map.Add("width", new PropertyValue((float)outline.Width));
 
             return map;
         }
@@ -1548,11 +1552,17 @@ namespace Tizen.NUI.BaseComponents
         {
             var map = new PropertyMap();
             map.Add("enable", new PropertyValue(textFit.Enable));
-            map.Add("minSize", new PropertyValue(textFit.MinSize));
-            map.Add("maxSize", new PropertyValue(textFit.MaxSize));
-            map.Add("stepSize", new PropertyValue(textFit.StepSize));
             map.Add("fontSizeType", new PropertyValue(GetFontSizeString(textFit.FontSizeType)));
 
+            if (textFit.MinSize != null)
+                map.Add("minSize", new PropertyValue((float)textFit.MinSize));
+
+            if (textFit.MaxSize != null)
+                map.Add("maxSize", new PropertyValue((float)textFit.MaxSize));
+
+            if (textFit.StepSize != null)
+                map.Add("stepSize", new PropertyValue((float)textFit.StepSize));
+
             return map;
         }
 
index c463bfa..89bd24f 100755 (executable)
@@ -2114,10 +2114,10 @@ namespace Tizen.NUI
             public Color Color { get; set; }
 
             /// <summary>
-            /// The height in pixels of the underline (the default value is 1.0f, value can not be set to 0.0f, if set to 0.0f then the height is set to 1.0f).
+            /// The height in pixels of the underline (if null, the default value is 1.0f).
             /// </summary>
             [EditorBrowsable(EditorBrowsableState.Never)]
-            public float Height { get; set; }
+            public float? Height { get; set; }
         }
 
         /// <summary>
@@ -2137,16 +2137,19 @@ namespace Tizen.NUI
             public Color Color { get; set; }
 
             /// <summary>
-            /// The offset in pixels of the shadow (If not provided then the shadow is not enabled).
+            /// The offset in pixels of the shadow (if null, the default value is 0, 0). <br />
+            /// If not provided then the shadow is not enabled. <br />
+            ///  
             /// </summary>
             [EditorBrowsable(EditorBrowsableState.Never)]
             public Vector2 Offset { get; set; }
 
             /// <summary>
-            /// The radius of the Gaussian blur for the soft shadow (If not provided then the soft shadow is not enabled).
+            /// The radius of the Gaussian blur for the soft shadow (if null, the default value is 0.0f). <br />
+            /// If not provided then the soft shadow is not enabled. <br />
             /// </summary>
             [EditorBrowsable(EditorBrowsableState.Never)]
-            public float BlurRadius { get; set; }
+            public float? BlurRadius { get; set; }
         }
 
         /// <summary>
@@ -2166,10 +2169,11 @@ namespace Tizen.NUI
             public Color Color { get; set; }
 
             /// <summary>
-            /// The width in pixels of the outline (If not provided then the outline is not enabled).
+            /// The width in pixels of the outline (if null, the default value is 0.0f). <br />
+            /// If not provided then the outline is not enabled. <br />
             /// </summary>
             [EditorBrowsable(EditorBrowsableState.Never)]
-            public float Width { get; set; }
+            public float? Width { get; set; }
         }
 
         /// <summary>
@@ -2189,22 +2193,22 @@ namespace Tizen.NUI
             public bool Enable { get; set; }
 
             /// <summary>
-            /// Minimum Size for text fit.
+            /// Minimum Size for text fit (if null, the default value is 10.0f).
             /// </summary>
             [EditorBrowsable(EditorBrowsableState.Never)]
-            public float MinSize { get; set; }
+            public float? MinSize { get; set; }
 
             /// <summary>
-            /// Maximum Size for text fit.
+            /// Maximum Size for text fit (if null, the default value is 100.0f).
             /// </summary>
             [EditorBrowsable(EditorBrowsableState.Never)]
-            public float MaxSize { get; set; }
+            public float? MaxSize { get; set; }
 
             /// <summary>
-            /// Step Size for font increase.
+            /// Step Size for font increase (if null, the default value is 1.0f).
             /// </summary>
             [EditorBrowsable(EditorBrowsableState.Never)]
-            public float StepSize { get; set; }
+            public float? StepSize { get; set; }
 
             /// <summary>
             /// The size type of font, PointSize or PixelSize (the default value is PointSize).