[NUI] Remove Default field from UI structs except UIColor
authorJiyun Yang <ji.yang@samsung.com>
Wed, 16 Apr 2025 05:03:22 +0000 (14:03 +0900)
committerSangHyeon Jade Lee <dltkdgus1764@gmail.com>
Thu, 17 Apr 2025 07:55:55 +0000 (16:55 +0900)
Signed-off-by: Jiyun Yang <ji.yang@samsung.com>
src/Tizen.NUI.Extension/Markup/ViewExtensions.cs
src/Tizen.NUI/src/devel/Lite/UICorner.cs
src/Tizen.NUI/src/devel/Lite/UIExtents.cs
src/Tizen.NUI/src/devel/Lite/UIShadow.cs
src/Tizen.NUI/src/public/BaseComponents/ViewLiteProperty.cs

index 951d01ea11699868d143ea042763b49c5543c74e..8ecae885699f047a2767117b577d458c48baf4e9 100644 (file)
@@ -278,7 +278,7 @@ namespace Tizen.NUI.Extension
         /// <returns>The view itself.</returns>
         public static T BoxShadow<T>(this T view, float blurRadius, float offsetX = 0, float offsetY = 0) where T : View
         {
-            return view.BoxShadow(new UIShadow(blurRadius, offsetX, offsetY));
+            return view.BoxShadow(new UIShadow(blurRadius, UIColor.Black, offsetX, offsetY));
         }
 
         /// <summary>
index b856368d4e41281e729c63ae286d0376c470a262..b618d7b3da4fc293b179aa39f303e29fcd29029a 100644 (file)
@@ -25,11 +25,6 @@ namespace Tizen.NUI
     [EditorBrowsable(EditorBrowsableState.Never)]
     public struct UICorner : IEquatable<UICorner>
     {
-        /// <summary>
-        /// The default corner. (This is to distinguish from zero corners)
-        /// </summary>
-        public static readonly UICorner Default = new (-1, -1, -1, -1);
-
         /// <summary>
         /// The zero corner.
         /// </summary>
@@ -81,9 +76,9 @@ namespace Tizen.NUI
         }
 
         /// <summary>
-        /// Gets a value indicating whether this is default.
+        /// Gets a value indicating whether this is NaN.
         /// </summary>
-        public readonly bool IsDefault => TopLeft == -1 && TopRight == -1 && BottomRight == -1 && BottomLeft == -1;
+        public readonly bool IsNaN => float.IsNaN(TopLeft) && float.IsNaN(TopRight) && float.IsNaN(BottomRight) && float.IsNaN(BottomLeft);
 
         /// <summary>
         /// Gets a value indicating whether this is zero.
index 44455fc0a76ac4cc8c705f538ea361fe40257c50..e54f4c03623b4fcd6caae09f2081a9936f184365 100644 (file)
@@ -9,6 +9,11 @@ namespace Tizen.NUI
     [EditorBrowsable(EditorBrowsableState.Never)]
     public struct UIExtents : IEquatable<UIExtents>
     {
+        /// <summary>
+        /// Represents a <see cref="UIExtents"/> with all values set to 0.
+        /// </summary>
+        public static readonly UIExtents Zero = new (0);
+
         /// <summary>
         /// Initializes a new instance of the <see cref="UIExtents"/> struct with the specified uniform size.
         /// </summary>
@@ -72,9 +77,9 @@ namespace Tizen.NUI
         public float VerticalExtents => Top + Bottom;
 
         /// <summary>
-        /// Gets a value indicating whether all borders have a width of 0.
+        /// Gets a value indicating whether this is zero.
         /// </summary>
-        public bool IsEmpty => Start == 0 && Top == 0 && End == 0 && Bottom == 0;
+        public readonly bool IsZero => Start == 0 && Top == 0 && End == 0 && Bottom == 0;
 
         /// <summary>
         /// Gets a value indicating whether any border has a width of NaN.
@@ -156,11 +161,6 @@ namespace Tizen.NUI
             bottom = Bottom;
         }
 
-        /// <summary>
-        /// Represents a <see cref="UIExtents"/> with all values set to 0.
-        /// </summary>
-        public static readonly UIExtents Zero = new (0);
-
         /// <summary>
         /// Adds the specified <see cref="float"/> to each component of the <see cref="UIExtents"/>.
         /// </summary>
index 2b1d87acc7db436bf508b9a3e69e7854b0665369..53640ee5d14033eb6349a25f71fb52f19f2dc123 100644 (file)
@@ -26,24 +26,23 @@ namespace Tizen.NUI
     [EditorBrowsable(EditorBrowsableState.Never)]
     public struct UIShadow : IEquatable<UIShadow>
     {
-        private static readonly UIColor s_defaultColor = UIColor.Black;
-
         /// <summary>
-        /// The default shadow value.
+        /// The none shadow.
         /// </summary>
-        public static UIShadow Default => new UIShadow(0f, UIColor.Transparent);
+        public static UIShadow None => new UIShadow(0f, UIColor.Transparent);
 
         /// <summary>
         /// Create a Shadow.
         /// </summary>
         /// <param name="blurRadius">The blur radius value for the shadow. Bigger value, much blurry.</param>
+        /// <param name="color">The color for the shadow.</param>
         /// <param name="offsetX">Optional. The x offset value from the top left corner. The default is 0.</param>
         /// <param name="offsetY">Optional. The y offset value from the top left corner. The default is 0.</param>
         /// <param name="extraWidth">Optional. The shadow will extend its size by specified amount of length. The default is 0.</param>
         /// <param name="extraHeight">Optional. The shadow will extend its size by specified amount of length. The default is 0.</param>
-        /// <param name="cutoutPolicy">The policy of the shadow cutout. The default is <see cref="ColorVisualCutoutPolicyType.None"/>.</param>
-        public UIShadow(float blurRadius, float offsetX = 0, float offsetY = 0, float extraWidth = 0, float extraHeight = 0, ColorVisualCutoutPolicyType cutoutPolicy = ColorVisualCutoutPolicyType.None)
-            : this(blurRadius, s_defaultColor, offsetX, offsetY, extraWidth, extraHeight, cutoutPolicy)
+        /// <param name="cutoutInner">Optional. Whether the shadow should be cutout with inner space of the target view. The default is false.</param>
+        public UIShadow(float blurRadius, UIColor color, float offsetX = 0, float offsetY = 0, float extraWidth = 0, float extraHeight = 0, bool cutoutInner = false)
+            : this(blurRadius, color, offsetX, offsetY, extraWidth, extraHeight, cutoutInner ? ColorVisualCutoutPolicyType.CutoutViewWithCornerRadius : ColorVisualCutoutPolicyType.None)
         {
         }
 
@@ -52,12 +51,12 @@ namespace Tizen.NUI
         /// </summary>
         /// <param name="blurRadius">The blur radius value for the shadow. Bigger value, much blurry.</param>
         /// <param name="color">The color for the shadow.</param>
-        /// <param name="offsetX">Optional. The x offset value from the top left corner. The default is 0.</param>
-        /// <param name="offsetY">Optional. The y offset value from the top left corner. The default is 0.</param>
-        /// <param name="extraWidth">Optional. The shadow will extend its size by specified amount of length. The default is 0.</param>
-        /// <param name="extraHeight">Optional. The shadow will extend its size by specified amount of length. The default is 0.</param>
+        /// <param name="offsetX">The x offset value from the top left corner. The default is 0.</param>
+        /// <param name="offsetY">The y offset value from the top left corner. The default is 0.</param>
+        /// <param name="extraWidth">The shadow will extend its size by specified amount of length. The default is 0.</param>
+        /// <param name="extraHeight">The shadow will extend its size by specified amount of length. The default is 0.</param>
         /// <param name="cutoutPolicy">The policy of the shadow cutout. The default is <see cref="ColorVisualCutoutPolicyType.None"/>.</param>
-        public UIShadow(float blurRadius, UIColor color, float offsetX = 0, float offsetY = 0, float extraWidth = 0, float extraHeight = 0, ColorVisualCutoutPolicyType cutoutPolicy = ColorVisualCutoutPolicyType.None)
+        public UIShadow(float blurRadius, UIColor color, float offsetX, float offsetY, float extraWidth, float extraHeight, ColorVisualCutoutPolicyType cutoutPolicy)
         {
             BlurRadius = blurRadius;
             Color = color;
@@ -146,9 +145,9 @@ namespace Tizen.NUI
         }
 
         /// <summary>
-        /// Whether this shadow is default.
+        /// Whether this shadow is none.
         /// </summary>
-        public bool IsDefault => BlurRadius == 0 && Color == UIColor.Transparent && OffsetX == 0 && OffsetY == 0 && ExtraWidth == 0 && ExtraHeight == 0 && CutoutPolicy == ColorVisualCutoutPolicyType.None;
+        public bool IsNone => BlurRadius == 0 && Color == UIColor.Transparent && OffsetX == 0 && OffsetY == 0 && ExtraWidth == 0 && ExtraHeight == 0 && CutoutPolicy == ColorVisualCutoutPolicyType.None;
 
         /// <summary>
         /// Whether this is equivalent to other.
index b6613867acad5dbc16a65a5129c3040cfa696e66..b799a150cc5b32ce6436b6600f827ad5a09addc2 100755 (executable)
@@ -83,7 +83,7 @@ namespace Tizen.NUI.BaseComponents
                     };
                 }
             }
-            return UIShadow.Default;
+            return UIShadow.None;
         }
 
         internal bool UpdateBoxShadowColor(UIColor color)