summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.Tizen
diff options
context:
space:
mode:
authorSeunghyun Choi <sh4682.choi@samsung.com>2017-03-30 15:45:46 +0900
committerSeunghyun Choi <sh4682.choi@samsung.com>2017-03-30 16:08:37 +0900
commit9c1f1e1b6a84f6585b4dad3ce6045cbe1a191305 (patch)
treeaccabf24833ec0539e32f02b29aa1af75aa87743 /Xamarin.Forms.Platform.Tizen
parent8e757e12b8a99c99ae65fa2acc46861716d84096 (diff)
downloadxamarin-forms-9c1f1e1b6a84f6585b4dad3ce6045cbe1a191305.tar.gz
xamarin-forms-9c1f1e1b6a84f6585b4dad3ce6045cbe1a191305.tar.bz2
xamarin-forms-9c1f1e1b6a84f6585b4dad3ce6045cbe1a191305.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>
Diffstat (limited to 'Xamarin.Forms.Platform.Tizen')
-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