SpaceBetweenButtonTextAndIcon = 0;
Space = new Vector4(0, 0, 0, 0);
ListRelativeOrientation = DropDown.ListOrientation.Left;
- ListMargin = new Vector4(0, 0, 0, 0);
+ ListMargin = new Extents(0, 0, 0, 0);
FocusedItemIndex = 0;
}
/// <summary>
if (attributes.ListMargin != null)
{
- ListMargin = new Vector4(attributes.ListMargin.X, attributes.ListMargin.Y, attributes.ListMargin.Z, attributes.ListMargin.W);
+ ListMargin = new Extents(attributes.ListMargin.Start, attributes.ListMargin.End, attributes.ListMargin.Top, attributes.ListMargin.Bottom);
}
if (attributes.ListSize != null)
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public Vector4 ListMargin
+ public Extents ListMargin
{
get;
set;
CheckImageAttributes = attributes.CheckImageAttributes.Clone() as ImageAttributes;
}
- CheckImageRightSpace = attributes.CheckImageRightSpace;
+ CheckImageGapToBoundary = attributes.CheckImageGapToBoundary;
IsSelected = attributes.IsSelected;
}
}
/// <summary>
- /// Right space from check image.
+ /// Gap of Check image to boundary.
/// </summary>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public int CheckImageRightSpace
+ public int CheckImageGapToBoundary
{
get;
set;
}
/// <summary>
- /// Check image's attributes.
+ /// Selectable image's attributes.
/// </summary>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public TabAttributes() : base()
{
- Space = new Vector4(0, 0, 0, 0);
+ Space = new Extents(0, 0, 0, 0);
UseTextNaturalSize = false;
ItemSpace = 0;
}
if (attributes.Space != null)
{
- Space = new Vector4(attributes.Space.X, attributes.Space.Y, attributes.Space.Z, attributes.Space.W);
+ Space = new Extents(attributes.Space.Start, attributes.Space.End, attributes.Space.Top, attributes.Space.Bottom);
}
else
{
- Space = new Vector4(0, 0, 0, 0);
+ Space = new Extents(0, 0, 0, 0);
}
ItemSpace = attributes.ItemSpace;
UseTextNaturalSize = attributes.UseTextNaturalSize;
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public Vector4 Space
+ public Extents Space
{
get;
set;
public class TextFieldAttributes : ViewAttributes
{
/// <summary>
- /// Creates a new instance of a TextField.
+ /// Creates a new instance of a TextFieldAttributes.
/// </summary>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
public TextFieldAttributes() : base() { }
/// <summary>
- /// Creates a new instance of a TextField with style.
+ /// Construct with specified attribute.
/// </summary>
- /// <param name="attributes">Create TextField by special style defined in UX.</param>
+ /// <param name="attributes">The specified TextFieldAttributes.</param>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
Opacity = attributes.Opacity.Clone() as FloatSelector;
}
- PaddingLeft = attributes.PaddingLeft;
- PaddingRight = attributes.PaddingRight;
- PaddingTop = attributes.PaddingTop;
- PaddingBottom = attributes.PaddingBottom;
+ Padding.CopyFrom(attributes.Padding);
}
/// <summary>
/// View Position
set;
}
/// <summary>
- /// View left padding
+ /// View padding
/// </summary>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public int PaddingLeft
- {
- get;
- set;
- }
- /// <summary>
- /// View right padding
- /// </summary>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public int PaddingRight
- {
- get;
- set;
- }
- /// <summary>
- /// View top padding
- /// </summary>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public int PaddingTop
- {
- get;
- set;
- }
- /// <summary>
- /// View bottom padding
- /// </summary>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public int PaddingBottom
+ public Extents Padding
{
get;
set;
private bool isSelected = false;
private bool isEnabled = true;
private bool isPressed = false;
+
+ private Extents iconPadding = null;
+ private Extents textPadding = null;
+
/// <summary>
/// Creates a new instance of a Button.
/// </summary>
{
get
{
- if (null == buttonAttributes || null == buttonAttributes.IconAttributes)
- {
- return null;
- }
- else
- {
- return new Extents((ushort)buttonAttributes.IconAttributes.PaddingLeft, (ushort)buttonAttributes.IconAttributes.PaddingRight, (ushort)buttonAttributes.IconAttributes.PaddingTop, (ushort)buttonAttributes.IconAttributes.PaddingBottom);
- }
+ return iconPadding;
}
set
{
if (null != value)
{
CreateIconAttributes();
- buttonAttributes.IconAttributes.PaddingLeft = value.Start;
- buttonAttributes.IconAttributes.PaddingRight = value.End;
- buttonAttributes.IconAttributes.PaddingTop = value.Top;
- buttonAttributes.IconAttributes.PaddingBottom = value.Bottom;
+ buttonAttributes.IconAttributes.Padding.CopyFrom(value);
+
+ if (null == iconPadding)
+ {
+ iconPadding = new Extents((ushort start, ushort end, ushort top, ushort bottom) =>
+ {
+ buttonAttributes.IconAttributes.Padding.Start = start;
+ buttonAttributes.IconAttributes.Padding.End = end;
+ buttonAttributes.IconAttributes.Padding.Top = top;
+ buttonAttributes.IconAttributes.Padding.Bottom = bottom;
+ RelayoutRequest();
+ }, value.Start, value.End, value.Top, value.Bottom);
+ }
+ else
+ {
+ iconPadding.CopyFrom(value);
+ }
+
RelayoutRequest();
}
}
{
get
{
- if (null == buttonAttributes || null == buttonAttributes.TextAttributes)
- {
- return null;
- }
- else
- {
- return new Extents((ushort)buttonAttributes.TextAttributes.PaddingLeft, (ushort)buttonAttributes.TextAttributes.PaddingRight, (ushort)buttonAttributes.TextAttributes.PaddingTop, (ushort)buttonAttributes.TextAttributes.PaddingBottom);
- }
+ return textPadding;
}
set
{
if (null != value)
{
CreateTextAttributes();
- buttonAttributes.TextAttributes.PaddingLeft = value.Start;
- buttonAttributes.TextAttributes.PaddingRight = value.End;
- buttonAttributes.TextAttributes.PaddingTop = value.Top;
- buttonAttributes.TextAttributes.PaddingBottom = value.Bottom;
+
+ buttonAttributes.TextAttributes.Padding.CopyFrom(value);
+
+ if (null == textPadding)
+ {
+ textPadding = new Extents((ushort start, ushort end, ushort top, ushort bottom) =>
+ {
+ buttonAttributes.TextAttributes.Padding.Start = start;
+ buttonAttributes.TextAttributes.Padding.End = end;
+ buttonAttributes.TextAttributes.Padding.Top = top;
+ buttonAttributes.TextAttributes.Padding.Bottom = bottom;
+ RelayoutRequest();
+ }, value.Start, value.End, value.Top, value.Bottom);
+ }
+ else
+ {
+ textPadding.CopyFrom(value);
+ }
+
RelayoutRequest();
}
}
}
buttonText.WidthResizePolicy = ResizePolicyType.Fixed;
buttonText.HeightResizePolicy = ResizePolicyType.Fixed;
- int textPaddingLeft = buttonAttributes.TextAttributes.PaddingLeft;
- int textPaddingRight = buttonAttributes.TextAttributes.PaddingRight;
- int textPaddingTop = buttonAttributes.TextAttributes.PaddingTop;
- int textPaddingBottom = buttonAttributes.TextAttributes.PaddingBottom;
+ int textPaddingStart = buttonAttributes.TextAttributes.Padding.Start;
+ int textPaddingEnd = buttonAttributes.TextAttributes.Padding.End;
+ int textPaddingTop = buttonAttributes.TextAttributes.Padding.Top;
+ int textPaddingBottom = buttonAttributes.TextAttributes.Padding.Bottom;
- int iconPaddingLeft = buttonAttributes.IconAttributes.PaddingLeft;
- int iconPaddingRight = buttonAttributes.IconAttributes.PaddingRight;
- int iconPaddingTop = buttonAttributes.IconAttributes.PaddingTop;
- int iconPaddingBottom = buttonAttributes.IconAttributes.PaddingBottom;
+ int iconPaddingStart = buttonAttributes.IconAttributes.Padding.Start;
+ int iconPaddingEnd = buttonAttributes.IconAttributes.Padding.End;
+ int iconPaddingTop = buttonAttributes.IconAttributes.Padding.Top;
+ int iconPaddingBottom = buttonAttributes.IconAttributes.Padding.Bottom;
if (IconRelativeOrientation == IconOrientation.Top || IconRelativeOrientation == IconOrientation.Bottom)
{
- buttonText.SizeWidth = SizeWidth - textPaddingLeft - textPaddingRight;
+ buttonText.SizeWidth = SizeWidth - textPaddingStart - textPaddingEnd;
buttonText.SizeHeight = SizeHeight - textPaddingTop - textPaddingBottom - iconPaddingTop - iconPaddingBottom - buttonIcon.SizeHeight;
}
else
{
- buttonText.SizeWidth = SizeWidth - textPaddingLeft - textPaddingRight - iconPaddingLeft - iconPaddingRight - buttonIcon.SizeWidth;
+ buttonText.SizeWidth = SizeWidth - textPaddingStart - textPaddingEnd - iconPaddingStart - iconPaddingEnd - buttonIcon.SizeWidth;
buttonText.SizeHeight = SizeHeight - textPaddingTop - textPaddingBottom;
}
}
return;
}
- int textPaddingLeft = buttonAttributes.TextAttributes.PaddingLeft;
- int textPaddingRight = buttonAttributes.TextAttributes.PaddingRight;
- int textPaddingTop = buttonAttributes.TextAttributes.PaddingTop;
- int textPaddingBottom = buttonAttributes.TextAttributes.PaddingBottom;
+ int textPaddingStart = buttonAttributes.TextAttributes.Padding.Start;
+ int textPaddingEnd = buttonAttributes.TextAttributes.Padding.End;
+ int textPaddingTop = buttonAttributes.TextAttributes.Padding.Top;
+ int textPaddingBottom = buttonAttributes.TextAttributes.Padding.Bottom;
- int iconPaddingLeft = buttonAttributes.IconAttributes.PaddingLeft;
- int iconPaddingRight = buttonAttributes.IconAttributes.PaddingRight;
- int iconPaddingTop = buttonAttributes.IconAttributes.PaddingTop;
- int iconPaddingBottom = buttonAttributes.IconAttributes.PaddingBottom;
+ int iconPaddingStart = buttonAttributes.IconAttributes.Padding.Start;
+ int iconPaddingEnd = buttonAttributes.IconAttributes.Padding.End;
+ int iconPaddingTop = buttonAttributes.IconAttributes.Padding.Top;
+ int iconPaddingBottom = buttonAttributes.IconAttributes.Padding.Bottom;
switch (IconRelativeOrientation)
{
buttonIcon.PositionUsesPivotPoint = true;
buttonIcon.ParentOrigin = NUI.ParentOrigin.CenterLeft;
buttonIcon.PivotPoint = NUI.PivotPoint.CenterLeft;
- buttonIcon.Position2D = new Position2D(iconPaddingLeft, 0);
+ buttonIcon.Position2D = new Position2D(iconPaddingStart, 0);
buttonText.PositionUsesPivotPoint = true;
buttonText.ParentOrigin = NUI.ParentOrigin.CenterRight;
buttonText.PivotPoint = NUI.PivotPoint.CenterRight;
- buttonText.Position2D = new Position2D(-textPaddingRight, 0);
+ buttonText.Position2D = new Position2D(-textPaddingEnd, 0);
}
else
{
buttonIcon.PositionUsesPivotPoint = true;
buttonIcon.ParentOrigin = NUI.ParentOrigin.CenterRight;
buttonIcon.PivotPoint = NUI.PivotPoint.CenterRight;
- buttonIcon.Position2D = new Position2D(-iconPaddingLeft, 0);
+ buttonIcon.Position2D = new Position2D(-iconPaddingStart, 0);
buttonText.PositionUsesPivotPoint = true;
buttonText.ParentOrigin = NUI.ParentOrigin.CenterLeft;
buttonText.PivotPoint = NUI.PivotPoint.CenterLeft;
- buttonText.Position2D = new Position2D(textPaddingRight, 0);
+ buttonText.Position2D = new Position2D(textPaddingEnd, 0);
}
break;
buttonIcon.PositionUsesPivotPoint = true;
buttonIcon.ParentOrigin = NUI.ParentOrigin.CenterLeft;
buttonIcon.PivotPoint = NUI.PivotPoint.CenterLeft;
- buttonIcon.Position2D = new Position2D(iconPaddingRight, 0);
+ buttonIcon.Position2D = new Position2D(iconPaddingEnd, 0);
buttonText.PositionUsesPivotPoint = true;
buttonText.ParentOrigin = NUI.ParentOrigin.CenterRight;
buttonText.PivotPoint = NUI.PivotPoint.CenterRight;
- buttonText.Position2D = new Position2D(-textPaddingLeft, 0);
+ buttonText.Position2D = new Position2D(-textPaddingStart, 0);
}
else
{
buttonIcon.PositionUsesPivotPoint = true;
buttonIcon.ParentOrigin = NUI.ParentOrigin.CenterRight;
buttonIcon.PivotPoint = NUI.PivotPoint.CenterRight;
- buttonIcon.Position2D = new Position2D(-iconPaddingRight, 0);
+ buttonIcon.Position2D = new Position2D(-iconPaddingEnd, 0);
buttonText.PositionUsesPivotPoint = true;
buttonText.ParentOrigin = NUI.ParentOrigin.CenterLeft;
buttonText.PivotPoint = NUI.PivotPoint.CenterLeft;
- buttonText.Position2D = new Position2D(textPaddingLeft, 0);
+ buttonText.Position2D = new Position2D(textPaddingStart, 0);
}
break;
default:
private DropDownItemView touchedView = null;
private int selectedItemIndex = -1;
+ private Extents listMargin = null;
+ private Extents listPadding = null;
+
/// <summary>
/// Creates a new instance of a DropDown.
/// </summary>
}
/// <summary>
- /// Left space in list.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public int ListLeftMargin
- {
- get
- {
- return (int)dropDownAttributes.ListMargin.X;
- }
- set
- {
- dropDownAttributes.ListMargin.X = value;
- RelayoutRequest();
- }
- }
-
- /// <summary>
- /// Right space in list.
+ /// Space in list.
/// </summary>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public int ListRigthMargin
+ public Extents ListMargin
{
get
{
- return (int)dropDownAttributes.ListMargin.Y;
+ return listMargin;
}
set
{
- dropDownAttributes.ListMargin.Y = value;
- RelayoutRequest();
- }
- }
+ dropDownAttributes.ListMargin.CopyFrom(value);
- /// <summary>
- /// Top space in list.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public int ListTopMargin
- {
- get
- {
- return (int)dropDownAttributes.ListMargin.Z;
- }
- set
- {
- dropDownAttributes.ListMargin.Z = value;
- RelayoutRequest();
- }
- }
+ if (null == listMargin)
+ {
+ listMargin = new Extents((ushort start, ushort end, ushort top, ushort bottom) =>
+ {
+ dropDownAttributes.ListMargin.Start = start;
+ dropDownAttributes.ListMargin.End = end;
+ dropDownAttributes.ListMargin.Top = top;
+ dropDownAttributes.ListMargin.Bottom = bottom;
+ RelayoutRequest();
+ }, value.Start, value.End, value.Top, value.Bottom);
+ }
+ else
+ {
+ listMargin.CopyFrom(value);
+ }
- /// <summary>
- /// Bottom space in list.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public int ListBottomMargin
- {
- get
- {
- return (int)dropDownAttributes.ListMargin.W;
- }
- set
- {
- dropDownAttributes.ListMargin.W = value;
RelayoutRequest();
}
}
{
get
{
- return dropDownAttributes.ListPadding;
+ return listPadding;
}
set
{
- dropDownAttributes.ListPadding = value;
+ dropDownAttributes.ListPadding.CopyFrom(value);
+
+ if (null == listPadding)
+ {
+ listPadding = new Extents((ushort start, ushort end, ushort top, ushort bottom) =>
+ {
+ dropDownAttributes.ListPadding.Start = start;
+ dropDownAttributes.ListPadding.End = end;
+ dropDownAttributes.ListPadding.Top = top;
+ dropDownAttributes.ListPadding.Bottom = bottom;
+ RelayoutRequest();
+ }, value.Start, value.End, value.Top, value.Bottom);
+ }
+ else
+ {
+ listMargin.CopyFrom(value);
+ }
+
RelayoutRequest();
}
}
{
if (dropDownAttributes.ListMargin != null)
{
- listBackgroundImageX = (int)dropDownAttributes.ListMargin.X;
- listBackgroundImageY = (int)dropDownAttributes.ListMargin.Z;
+ listBackgroundImageX = (int)dropDownAttributes.ListMargin.Start;
+ listBackgroundImageY = (int)dropDownAttributes.ListMargin.Top;
}
}
else if (dropDownAttributes.ListRelativeOrientation == ListOrientation.Right)
{
listWidth = list.Size2D.Width;
}
- listBackgroundImageX = Size2D.Width - listWidth - (int)dropDownAttributes.ListMargin.Y;
- listBackgroundImageY = (int)dropDownAttributes.ListMargin.Z;
+ listBackgroundImageX = Size2D.Width - listWidth - (int)dropDownAttributes.ListMargin.End;
+ listBackgroundImageY = (int)dropDownAttributes.ListMargin.Top;
}
}
listBackgroundImage.Position2D = new Position2D(listBackgroundImageX, listBackgroundImageY);
{
get
{
- return itemDataAttributes.CheckImageRightSpace;
+ return itemDataAttributes.CheckImageGapToBoundary;
}
set
{
- itemDataAttributes.CheckImageRightSpace = value;
+ itemDataAttributes.CheckImageGapToBoundary = value;
}
}
private SelectButtonAttributes selectButtonAttributes;
+ private Extents selectableImagePadding = null;
+
/// <summary>
/// Creates a new instance of a SelectButton.
/// </summary>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public int CheckImagePaddingLeft
+ public Extents SelectableImagePadding
{
get
{
- return selectButtonAttributes?.CheckImageAttributes?.PaddingLeft ?? 0;
+ return selectableImagePadding;
}
set
{
CreateCheckImageAttributes();
CreateCheckBackgroundImageAttributes();
CreateCheckShadowImageAttributes();
- selectButtonAttributes.CheckImageAttributes.PaddingLeft = value;
- selectButtonAttributes.CheckBackgroundImageAttributes.PaddingLeft = value;
- selectButtonAttributes.CheckShadowImageAttributes.PaddingLeft = value;
- RelayoutRequest();
- }
- }
- /// <summary>
- /// CheckImage right padding in SelectButton.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public int CheckImagePaddingRight
- {
- get
- {
- return selectButtonAttributes?.CheckImageAttributes?.PaddingRight ?? 0;
- }
- set
- {
- CreateCheckImageAttributes();
- CreateCheckBackgroundImageAttributes();
- CreateCheckShadowImageAttributes();
- selectButtonAttributes.CheckImageAttributes.PaddingRight = value;
- selectButtonAttributes.CheckBackgroundImageAttributes.PaddingRight = value;
- selectButtonAttributes.CheckShadowImageAttributes.PaddingRight = value;
- RelayoutRequest();
- }
- }
+ selectButtonAttributes.CheckImageAttributes.Padding.CopyFrom(value);
+ selectButtonAttributes.CheckBackgroundImageAttributes.Padding.CopyFrom(value);
+ selectButtonAttributes.CheckShadowImageAttributes.Padding.CopyFrom(value);
- /// <summary>
- /// CheckImage top padding in SelectButton.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public int CheckImagePaddingTop
- {
- get
- {
- return selectButtonAttributes?.CheckImageAttributes?.PaddingTop ?? 0;
- }
- set
- {
- CreateCheckImageAttributes();
- CreateCheckBackgroundImageAttributes();
- CreateCheckShadowImageAttributes();
- selectButtonAttributes.CheckImageAttributes.PaddingTop = value;
- selectButtonAttributes.CheckBackgroundImageAttributes.PaddingTop = value;
- selectButtonAttributes.CheckShadowImageAttributes.PaddingTop = value;
- RelayoutRequest();
- }
- }
+ if (null == selectableImagePadding)
+ {
+ selectableImagePadding = new Extents((ushort start, ushort end, ushort top, ushort bottom) =>
+ {
+ selectButtonAttributes.CheckImageAttributes.Padding.Start = start;
+ selectButtonAttributes.CheckImageAttributes.Padding.End = end;
+ selectButtonAttributes.CheckImageAttributes.Padding.Top = top;
+ selectButtonAttributes.CheckImageAttributes.Padding.Bottom = bottom;
+
+ selectButtonAttributes.CheckBackgroundImageAttributes.Padding.Start = start;
+ selectButtonAttributes.CheckBackgroundImageAttributes.Padding.End = end;
+ selectButtonAttributes.CheckBackgroundImageAttributes.Padding.Top = top;
+ selectButtonAttributes.CheckBackgroundImageAttributes.Padding.Bottom = bottom;
+
+ selectButtonAttributes.CheckShadowImageAttributes.Padding.Start = start;
+ selectButtonAttributes.CheckShadowImageAttributes.Padding.End = end;
+ selectButtonAttributes.CheckShadowImageAttributes.Padding.Top = top;
+ selectButtonAttributes.CheckShadowImageAttributes.Padding.Bottom = bottom;
+
+ RelayoutRequest();
+ }, value.Start, value.End, value.Top, value.Bottom);
+ }
+ else
+ {
+ selectableImagePadding.CopyFrom(value);
+ }
- /// <summary>
- /// CheckImage bottom padding in SelectButton.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public int CheckImagePaddingBottom
- {
- get
- {
- return selectButtonAttributes?.CheckImageAttributes?.PaddingBottom ?? 0;
- }
- set
- {
- CreateCheckImageAttributes();
- CreateCheckBackgroundImageAttributes();
- CreateCheckShadowImageAttributes();
- selectButtonAttributes.CheckImageAttributes.PaddingBottom = value;
- selectButtonAttributes.CheckBackgroundImageAttributes.PaddingBottom = value;
- selectButtonAttributes.CheckShadowImageAttributes.PaddingBottom = value;
RelayoutRequest();
}
}
int iconWidth = (int)CheckImageSize.Width;
- int textPaddingLeft = selectButtonAttributes.TextAttributes.PaddingLeft;
- int textPaddingRight = selectButtonAttributes.TextAttributes.PaddingRight;
+ int textPaddingLeft = selectButtonAttributes.TextAttributes.Padding.Start;
+ int textPaddingRight = selectButtonAttributes.TextAttributes.Padding.End;
if(selectButtonAttributes.TextAttributes.Size == null)
{
- selectButtonAttributes.TextAttributes.Size = new Size(Size2D.Width - iconWidth - CheckImagePaddingLeft - CheckImagePaddingRight - textPaddingLeft - textPaddingRight, Size2D.Height);
+ selectButtonAttributes.TextAttributes.Size = new Size(Size2D.Width - iconWidth - SelectableImagePadding.Start - SelectableImagePadding.End - textPaddingLeft - textPaddingRight, Size2D.Height);
}
if(selectButtonAttributes.TextAttributes.Position == null)
{
- selectButtonAttributes.TextAttributes.Position = new Position(CheckImagePaddingLeft + iconWidth + CheckImagePaddingRight + textPaddingLeft, 0);
+ selectButtonAttributes.TextAttributes.Position = new Position(SelectableImagePadding.Start + iconWidth + SelectableImagePadding.End + textPaddingLeft, 0);
}
selectButtonAttributes.TextAttributes.VerticalAlignment = VerticalAlignment.Center;
int iconWidth = (int)CheckImageSize.Width;
- int textPaddingLeft = selectButtonAttributes.TextAttributes.PaddingLeft;
- int textPaddingRight = selectButtonAttributes.TextAttributes.PaddingRight;
+ int textPaddingLeft = selectButtonAttributes.TextAttributes.Padding.Start;
+ int textPaddingRight = selectButtonAttributes.TextAttributes.Padding.End;
int pos = 0;
if (LayoutDirection == ViewLayoutDirectionType.RTL)
{
private TabAttributes tabAttributes = null;
private Animation underlineAni = null;
private bool isNeedAnimation = false;
+ private Extents space;
/// <summary>
/// Creates a new instance of a Tab.
{
get
{
- if(null == tabAttributes || null == tabAttributes.Space)
- {
- return null;
- }
- else
- {
- return new Extents((ushort)tabAttributes.Space.X, (ushort)tabAttributes.Space.Y, (ushort)tabAttributes.Space.Z, (ushort)tabAttributes.Space.W);
- }
+ return space;
}
set
{
if(null != value)
{
- tabAttributes.Space = new Vector4(value.Start, value.End, value.Top, value.Bottom);
+ tabAttributes.Space.CopyFrom(value);
+
+ if (null == space)
+ {
+ space = new Extents((ushort start, ushort end, ushort top, ushort bottom) =>
+ {
+ tabAttributes.Space.Start = start;
+ tabAttributes.Space.End = end;
+ tabAttributes.Space.Top = top;
+ tabAttributes.Space.Bottom = bottom;
+ RelayoutRequest();
+ }, value.Start, value.End, value.Top, value.Bottom);
+ }
+ else
+ {
+ space.CopyFrom(value);
+ }
+
RelayoutRequest();
}
}
return;
}
- int preX = (int)tabAttributes.Space.X;
+ int preX = (int)tabAttributes.Space.Start;
int preW = 0;
int itemSpace = tabAttributes.ItemSpace;
}
else
{
- preW = (Size2D.Width - (int)tabAttributes.Space.X - (int)tabAttributes.Space.Y) / totalNum;
+ preW = (Size2D.Width - (int)tabAttributes.Space.Start - (int)tabAttributes.Space.End) / totalNum;
for (int i = 0; i < totalNum; i++)
{
itemList[i].Position2D.X = preX;
}
else
{
- preX = (int)tabAttributes.Space.Y;
+ preX = (int)tabAttributes.Space.End;
if (tabAttributes.UseTextNaturalSize == true)
{
int w = Size2D.Width;
}
else
{
- preW = (Size2D.Width - (int)tabAttributes.Space.X - (int)tabAttributes.Space.Y) / totalNum;
+ preW = (Size2D.Width - (int)tabAttributes.Space.Start - (int)tabAttributes.Space.End) / totalNum;
for (int i = totalNum - 1; i >= 0; i--)
{
itemList[i].Position2D.X = preX;
private void AddItemByIndex(TabItemData itemData, int index)
{
int h = 0;
- int topSpace = (int)tabAttributes.Space.Z;
+ int topSpace = (int)tabAttributes.Space.Top;
if (tabAttributes.UnderLineAttributes != null && tabAttributes.UnderLineAttributes.Size != null)
{
h = (int)tabAttributes.UnderLineAttributes.Size.Height;
private NPatchVisual toastBackground = null;
private Timer timer = null;
+ private Extents textPadding = null;
+
private readonly int maxTextAreaWidth = 808;
private readonly uint textLineHeight = 56;
private readonly uint textLineSpace = 4;
{
get
{
- if (null != toastAttributes?.TextAttributes)
- {
- return new Extents((ushort)toastAttributes.TextAttributes.PaddingLeft, (ushort)toastAttributes.TextAttributes.PaddingRight, (ushort)toastAttributes.TextAttributes.PaddingTop, (ushort)toastAttributes.TextAttributes.PaddingBottom);
- }
- else
- {
- return null;
- }
+ return textPadding;
}
set
{
if (null != value)
{
CreateTextAttributes();
- toastAttributes.TextAttributes.PaddingLeft = value.Start;
- toastAttributes.TextAttributes.PaddingRight = value.End;
- toastAttributes.TextAttributes.PaddingTop = value.Top;
- toastAttributes.TextAttributes.PaddingBottom = value.Bottom;
+ toastAttributes.TextAttributes.Padding.CopyFrom(value);
+
+ if (null == textPadding)
+ {
+ textPadding = new Extents((ushort start, ushort end, ushort top, ushort bottom) =>
+ {
+ toastAttributes.TextAttributes.Padding.Start = start;
+ toastAttributes.TextAttributes.Padding.End = end;
+ toastAttributes.TextAttributes.Padding.Top = top;
+ toastAttributes.TextAttributes.Padding.Bottom = bottom;
+ RelayoutRequest();
+ }, value.Start, value.End, value.Top, value.Bottom);
+ }
+ else
+ {
+ textPadding.CopyFrom(value);
+ }
+
RelayoutRequest();
}
}
[EditorBrowsable(EditorBrowsableState.Never)]
protected virtual void LayoutChild()
{
- int _textPaddingLeft = toastAttributes.TextAttributes?.PaddingLeft ?? textPaddingLeft;
- int _textPaddingRight = toastAttributes.TextAttributes?.PaddingRight ?? _textPaddingLeft;
- int _textPaddingTop = toastAttributes.TextAttributes?.PaddingTop ?? textPaddingTop;
- int _textPaddingBottom = toastAttributes.TextAttributes?.PaddingBottom ?? _textPaddingTop;
+ int _textPaddingLeft = toastAttributes.TextAttributes?.Padding.Start ?? textPaddingLeft;
+ int _textPaddingRight = toastAttributes.TextAttributes?.Padding.End ?? _textPaddingLeft;
+ int _textPaddingTop = toastAttributes.TextAttributes?.Padding.Top ?? textPaddingTop;
+ int _textPaddingBottom = toastAttributes.TextAttributes?.Padding.Bottom ?? _textPaddingTop;
int _textAreaWidth = this.Size2D.Width - _textPaddingLeft - _textPaddingRight;
int _textAreaHeight = this.Size2D.Height - _textPaddingTop - _textPaddingBottom;
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
}
- internal Extents(ExtentsChangedCallback cb, ushort start, ushort end, ushort top, ushort bottom) : this(Interop.Extents.new_Extents__SWIG_2(start, end, top, bottom), true)
+ /// <summary>
+ /// Constructor
+ /// </summary>
+ /// <param name="cb"></param>
+ /// <param name="start"></param>
+ /// <param name="end"></param>
+ /// <param name="top"></param>
+ /// <param name="bottom"></param>
+ /// <since_tizen> Only used by Tizen.NUI.Components, will not be opened </since_tizen>
+ [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
+ public Extents(ExtentsChangedCallback cb, ushort start, ushort end, ushort top, ushort bottom) : this(Interop.Extents.new_Extents__SWIG_2(start, end, top, bottom), true)
{
callback = cb;
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
- internal delegate void ExtentsChangedCallback(ushort start, ushort end, ushort top, ushort botton);
+ /// <summary>
+ /// Copy other extents
+ /// </summary>
+ /// <param name="that"></param>
+ /// <since_tizen> Only used by Tizen.NUI.Components, will not be opened </since_tizen>
+ [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
+ public void CopyFrom(Extents that)
+ {
+ Interop.Extents.Extents_start_set(swigCPtr, that.Start);
+ Interop.Extents.Extents_end_set(swigCPtr, that.End);
+ Interop.Extents.Extents_top_set(swigCPtr, that.Top);
+ Interop.Extents.Extents_bottom_set(swigCPtr, that.End);
+ }
+
+ /// <summary>
+ /// Constructor
+ /// </summary>
+ /// <param name="cb"></param>
+ /// <param name="start"></param>
+ /// <param name="end"></param>
+ /// <param name="top"></param>
+ /// <param name="bottom"></param>
+ /// <since_tizen> Only used by Tizen.NUI.Components, will not be opened </since_tizen>
+ [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
+ public delegate void ExtentsChangedCallback(ushort start, ushort end, ushort top, ushort bottom);
private ExtentsChangedCallback callback = null;
/// <summary>