summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKangho Hur <kangho.hur@samsung.com>2017-04-06 07:05:23 (GMT)
committerGerrit Code Review <gerrit@review.vlan103.tizen.org>2017-04-06 07:05:23 (GMT)
commitcd867c1601790ca9599ca048e37b5f644a1b26bc (patch)
tree082893e6d542d68cc8b8525b81e0a3996b9af8a6
parent60bcc0e67ceda984216aabf051bcab9119dd334e (diff)
parent9c1f1e1b6a84f6585b4dad3ce6045cbe1a191305 (diff)
downloadxamarin-forms-cd867c1601790ca9599ca048e37b5f644a1b26bc.zip
xamarin-forms-cd867c1601790ca9599ca048e37b5f644a1b26bc.tar.gz
xamarin-forms-cd867c1601790ca9599ca048e37b5f644a1b26bc.tar.bz2
Merge "Fixed Button resize when changing style" into 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 71ec0c1..e6e0555 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