[NUI] Fix button CellPadding policy and default CornerRadius
authorJiyun Yang <ji.yang@samsung.com>
Wed, 2 Jun 2021 07:44:49 +0000 (16:44 +0900)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Tue, 8 Jun 2021 05:35:32 +0000 (14:35 +0900)
Signed-off-by: Jiyun Yang <ji.yang@samsung.com>
src/Tizen.NUI.Components/Controls/Button.Internal.cs
src/Tizen.NUI.Components/Theme/DefaultThemeCommon.cs

index dac424f836d1a90919d19c90fe6448bc12fa98a3..77388cabd098edd6c23824b8b570cff47627b92c 100644 (file)
@@ -335,13 +335,17 @@ namespace Tizen.NUI.Components
             buttonText.Unparent();
             overlayImage?.Unparent();
 
+#pragma warning disable CA2000
+            Size2D cellPadding = String.IsNullOrEmpty(buttonText.Text) ? new Size2D(0, 0) : itemSpacing;
+#pragma warning restore CA2000
+
             if (IconRelativeOrientation == IconOrientation.Left)
             {
                 Layout = new LinearLayout()
                 {
                     LinearOrientation = LinearLayout.Orientation.Horizontal,
                     LinearAlignment = itemAlignment,
-                    CellPadding = itemSpacing ?? new Size2D(0, 0)
+                    CellPadding = cellPadding
                 };
 
                 Add(buttonIcon);
@@ -353,7 +357,7 @@ namespace Tizen.NUI.Components
                 {
                     LinearOrientation = LinearLayout.Orientation.Horizontal,
                     LinearAlignment = itemAlignment,
-                    CellPadding = itemSpacing ?? new Size2D(0, 0)
+                    CellPadding = cellPadding
                 };
 
                 Add(buttonText);
@@ -365,7 +369,7 @@ namespace Tizen.NUI.Components
                 {
                     LinearOrientation = LinearLayout.Orientation.Vertical,
                     LinearAlignment = itemAlignment,
-                    CellPadding = itemSpacing ?? new Size2D(0, 0)
+                    CellPadding = cellPadding
                 };
 
                 Add(buttonIcon);
@@ -377,7 +381,7 @@ namespace Tizen.NUI.Components
                 {
                     LinearOrientation = LinearLayout.Orientation.Vertical,
                     LinearAlignment = itemAlignment,
-                    CellPadding = itemSpacing ?? new Size2D(0, 0)
+                    CellPadding = cellPadding
                 };
 
                 Add(buttonText);
index b5c9484065f0d904559ada23013741bd9e397457..6ccbbd8e9a0d0cc282f24b1193f01ae8ee19e8b6 100755 (executable)
@@ -36,8 +36,7 @@ namespace Tizen.NUI.Components
             theme.AddStyleWithoutClone("Tizen.NUI.Components.Button", new ButtonStyle()
             {
                 Size = new Size(339, 96),
-                CornerRadiusPolicy = VisualTransformPolicyType.Relative,
-                CornerRadius = 0.2916f,
+                CornerRadius = 28.0f,
                 ItemAlignment = LinearLayout.Alignment.Center,
                 BackgroundColor = new Selector<Color>()
                 {