From: Jaehyun Cho Date: Wed, 15 Feb 2023 11:02:05 +0000 (+0900) Subject: [NUI] Fix Button Theme not to set fixed size X-Git-Tag: submit/tizen_7.0/20230216.150906~1^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6abbb85ad2ceac1606192524b1bf8a2823829f73;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [NUI] Fix Button Theme not to set fixed size To increase Button width based on the Button's text, Button Theme sets MinimumSize instead of fixed Size. --- diff --git a/src/Tizen.NUI.Components/Controls/Button.Internal.cs b/src/Tizen.NUI.Components/Controls/Button.Internal.cs index 071f7f2..ea06e8f 100644 --- a/src/Tizen.NUI.Components/Controls/Button.Internal.cs +++ b/src/Tizen.NUI.Components/Controls/Button.Internal.cs @@ -435,11 +435,11 @@ namespace Tizen.NUI.Components if (iconRelativeOrientation == IconOrientation.Left || iconRelativeOrientation == IconOrientation.Right) { - lengthWithoutText += (itemSpacing?.Width ?? 0) + iconMargin.Start + iconMargin.End + textMargin.Start + textMargin.End; + lengthWithoutText += (itemSpacing?.Width ?? 0) + iconMargin.Start + iconMargin.End + textMargin.Start + textMargin.End + Padding.Start + Padding.End; } else { - lengthWithoutText += (itemSpacing?.Height ?? 0) + iconMargin.Top + iconMargin.Bottom + textMargin.Top + textMargin.Bottom; + lengthWithoutText += (itemSpacing?.Height ?? 0) + iconMargin.Top + iconMargin.Bottom + textMargin.Top + textMargin.Bottom + Padding.Top + Padding.Bottom; } } } diff --git a/src/Tizen.NUI.Components/Theme/DefaultThemeCommon.cs b/src/Tizen.NUI.Components/Theme/DefaultThemeCommon.cs index a73f021..e9adaad 100755 --- a/src/Tizen.NUI.Components/Theme/DefaultThemeCommon.cs +++ b/src/Tizen.NUI.Components/Theme/DefaultThemeCommon.cs @@ -39,7 +39,8 @@ namespace Tizen.NUI.Components // Button base style theme.AddStyleWithoutClone("Tizen.NUI.Components.Button", new ButtonStyle() { - Size = new Size(252, 48), + MinimumSize = new Size(252, 48), + Padding = new Extents(32, 32, 8, 8), ItemSpacing = new Size2D(8, 8), CornerRadius = 12.0f, ItemHorizontalAlignment = HorizontalAlignment.Center, @@ -62,7 +63,8 @@ namespace Tizen.NUI.Components // Outlined Button style theme.AddStyleWithoutClone("Tizen.NUI.Components.Button.Outlined", new ButtonStyle() { - Size = new Size(252, 48), + MinimumSize = new Size(252, 48), + Padding = new Extents(32, 32, 8, 8), ItemSpacing = new Size2D(8, 8), CornerRadius = 12.0f, BorderlineWidth = 2.0f, @@ -94,7 +96,6 @@ namespace Tizen.NUI.Components // TextOnly Button style theme.AddStyleWithoutClone("Tizen.NUI.Components.Button.TextOnly", new ButtonStyle() { - SizeHeight = 48, MinimumSize = new Size(120, 48), Padding = new Extents(32, 32, 8, 8), ItemHorizontalAlignment = HorizontalAlignment.Center,