public DirectionButtonStyle(Direction direction)
{
Text.TextColor.Disabled = new Color("#C3CAD2");
- Text.PixelSize = 24.0f;
+ Text.PixelSize = UnitsUtils.UnitsToPixels(6.0f);
NinePatchBackgroundColor.Disabled = NinePatchBackgroundColor.Normal;
NinePatchFrameColor.Disabled = NinePatchFrameColor.Normal;
{
case Direction.Previous:
Text.HorizontalAlignment = HorizontalAlignment.Begin;
- TextPadding = new Extents(20, 0, 0, 0);
+ TextPadding = new Extents(UnitsUtils.UnitsToPixels((ushort)5), 0, 0, 0);
IconRelativeOrientation = Button.IconOrientation.Left;
break;
case Direction.Next:
Text.HorizontalAlignment = HorizontalAlignment.End;
- IconPadding = new Extents(20, 0, 0, 0);
+ IconPadding = new Extents(UnitsUtils.UnitsToPixels((ushort)5), 0, 0, 0);
IconRelativeOrientation = Button.IconOrientation.Right;
break;
Icon = new ImageViewStyle
{
ResourceUrl = GetArrowIconPaths(direction),
+ Size = new Size2D(UnitsUtils.UnitsToPixels(20), UnitsUtils.UnitsToPixels(20)),
};
}
{
public class NinePatchButtonStyle : ButtonStyle
{
+ private const string Path = "*Resource*/styles/button/";
+ private const string Background = "9patch_fill";
+ private const string Frame = "9patch_outline";
+ private const string End = ".png";
+
public NinePatchButtonStyle()
{
// To avoid blinking:
Text = new TextLabelStyle
{
- PixelSize = 32.0f,
+ PixelSize = UnitsUtils.UnitsToPixels(8.0f),
FontFamily = "BreezeSans",
};
- NinePatchBackgroundImageUrl = "*Resource*/styles/button/9patch_fill_white.png";
-
- NinePatchFrameImageUrl = "*Resource*/styles/button/9patch_outline_white.png";
+ SetImagesUrl();
}
public string NinePatchBackgroundImageUrl { get; set; }
public string NinePatchFrameImageUrl { get; set; }
public Selector<Color> NinePatchFrameColor { get; set; }
+
+ private void SetImagesUrl()
+ {
+ int ninePatchSize = (int)Config.PixelsPerUnit;
+
+ NinePatchBackgroundImageUrl = Path + Background + ninePatchSize + End;
+
+ NinePatchFrameImageUrl = Path + Frame + ninePatchSize + End;
+ }
}
}