summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSeunghyun Choi <sh4682.choi@samsung.com>2017-03-30 15:45:46 +0900
committerKangho Hur <kangho.hur@samsung.com>2017-07-10 11:11:22 +0900
commit92575cc231d943802258555e1ce7cf21ac72e505 (patch)
treeee79f3aba6b8e311a99c8b54cac0daee3df10cee
parentb371f833e96f5059b49bd177c74b3beb40bd4a4b (diff)
downloadxamarin-forms-92575cc231d943802258555e1ce7cf21ac72e505.tar.gz
xamarin-forms-92575cc231d943802258555e1ce7cf21ac72e505.tar.bz2
xamarin-forms-92575cc231d943802258555e1ce7cf21ac72e505.zip
Fixed Button resize when changing style
- For normal operation, the following URL commits must be SR. - https://review.tizen.org/gerrit/#/c/121725/ Change-Id: I1ba3631aadf3f1c614371b48baf3d93195f0f599 Signed-off-by: Seunghyun Choi <sh4682.choi@samsung.com>
-rw-r--r--Xamarin.Forms.Platform.Tizen/Native/Button.cs32
1 files changed, 9 insertions, 23 deletions
diff --git a/Xamarin.Forms.Platform.Tizen/Native/Button.cs b/Xamarin.Forms.Platform.Tizen/Native/Button.cs
index 71ec0c10..e6e05556 100644
--- a/Xamarin.Forms.Platform.Tizen/Native/Button.cs
+++ b/Xamarin.Forms.Platform.Tizen/Native/Button.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using ElmSharp;
using EButton = ElmSharp.Button;
using ESize = ElmSharp.Size;
@@ -33,7 +33,6 @@ namespace Xamarin.Forms.Platform.Tizen.Native
/// <param name="parent">Parent evas object.</param>
public Button(EvasObject parent) : base(parent)
{
- _internalPadding = GetInternalPadding();
}
/// <summary>
@@ -201,6 +200,7 @@ namespace Xamarin.Forms.Platform.Tizen.Native
var padding = _internalPadding;
+ // TODO : If the efl theme for the circle button is modified, it will be deleted.
if (Style == "circle")
{
var circleTextPadding = (EdjeObject["icon_text_padding"]?.Geometry.Height).GetValueOrDefault(0);
@@ -271,21 +271,6 @@ namespace Xamarin.Forms.Platform.Tizen.Native
}
/// <summary>
- /// Gets the internal padding of the button.
- /// </summary>
- /// <returns>The internal padding.</returns>
- ESize GetInternalPadding()
- {
- var edje = EdjeObject;
-
- return new ESize
- {
- Width = (edje["padding_top_left"]?.Geometry.Width ?? 64) + (edje["padding_bottom_right"]?.Geometry.Width ?? 64),
- Height = edje["bg"]?.Geometry.Height ?? 64
- };
- }
-
- /// <summary>
/// Applies the image to be displayed on the button. If value is <c>null</c>,
/// image will be removed.
/// </summary>
@@ -312,29 +297,30 @@ namespace Xamarin.Forms.Platform.Tizen.Native
}
}
+ /// <summary>
+ /// Update the button's style
+ /// </summary>
+ /// <param name="style">The style of button</param>
public void UpdateStyle(string style)
{
if (Style != style)
{
Style = style;
+ //TODO : If the efl theme for the circle button is modified, will use MinimumWidth, MinimumHeight to get the size.
if (Style == "circle")
{
var circleSize = (EdjeObject["bg"]?.Geometry.Width).GetValueOrDefault(0);
_internalPadding = new ESize(circleSize, circleSize);
_span.HorizontalTextAlignment = TextAlignment.Center;
}
- else if (Style == "bottom")
- {
- _internalPadding = GetInternalPadding();
- _span.HorizontalTextAlignment = TextAlignment.Auto;
- }
else
{
+ _internalPadding = new ESize(MinimumWidth, MinimumHeight);
_span.HorizontalTextAlignment = TextAlignment.Auto;
}
ApplyTextAndStyle();
}
}
}
-}
+} \ No newline at end of file