// for config
private Size2D minSize = null;
private Size2D maxSize = null;
- private uint borderLineThickness;
+ private uint borderLineThickness = 0;
private BorderResizePolicyType borderResizePolicy = BorderResizePolicyType.Free;
#endregion //Fields
{
if (borderInterface != null)
{
+ bool isNeedResizeByLine = false;
+ bool isNeedResizeByBorder = false;
+ using var val = new Uint16Pair(Interop.Window.GetSize(SwigCPtr), true);
if (borderLineThickness != borderInterface.BorderLineThickness)
{
+ isNeedResizeByLine = true;
int diffBorderLine = (int)borderInterface.BorderLineThickness - (int)borderLineThickness;
borderLineThickness = borderInterface.BorderLineThickness;
}
}
- using var val = new Uint16Pair(Interop.Window.GetSize(SwigCPtr), true);
val.SetWidth((ushort)(val.GetWidth() + diffBorderLine * 2));
val.SetHeight((ushort)(val.GetHeight() + diffBorderLine * 2));
- Interop.Window.SetSize(SwigCPtr, Uint16Pair.getCPtr(val));
}
float height = 0;
if (hasBottomView) height += bottomView.SizeHeight;
if (height != borderHeight)
{
+ isNeedResizeByBorder = true;
float diff = height - borderHeight;
borderHeight = height;
- WindowSize = new Size2D(WindowSize.Width, WindowSize.Height + (int)(diff));
+ val.SetHeight((ushort)(val.GetHeight() + diff));
}
- if (minSize != borderInterface.MinSize)
+ if (isNeedResizeByLine == true || isNeedResizeByBorder == true)
{
- using Size2D mimimumSize = new Size2D((borderInterface.MinSize?.Width + (int)borderInterface.BorderLineThickness * 2 ?? 0), (borderInterface.MinSize?.Height ?? 0) + (int)(borderHeight + borderInterface.BorderLineThickness * 2));
+ Interop.Window.SetSize(SwigCPtr, Uint16Pair.getCPtr(val));
+ }
+
+ if (minSize != borderInterface.MinSize || (borderInterface.MinSize != null && isNeedResizeByLine == true))
+ {
+ using Size2D mimimumSize = new Size2D((borderInterface.MinSize?.Width + (int)borderLineThickness * 2 ?? 0), (borderInterface.MinSize?.Height ?? 0) + (int)(borderHeight + borderLineThickness * 2));
SetMimimumSize(mimimumSize);
minSize = borderInterface.MinSize;
}
- if (maxSize != borderInterface.MaxSize)
+ if (maxSize != borderInterface.MaxSize || (borderInterface.MaxSize != null && isNeedResizeByLine == true))
{
- using Size2D maximumSize = new Size2D((borderInterface.MaxSize?.Width + (int)borderInterface.BorderLineThickness * 2 ?? 0), (borderInterface.MaxSize?.Height ?? 0) + (int)(borderHeight + borderInterface.BorderLineThickness * 2));
+ using Size2D maximumSize = new Size2D((borderInterface.MaxSize?.Width + (int)borderLineThickness * 2 ?? 0), (borderInterface.MaxSize?.Height ?? 0) + (int)(borderHeight + borderLineThickness * 2));
SetMaximumSize(maximumSize);
maxSize = borderInterface.MaxSize;
}
}
this.borderInterface = borderInterface;
this.borderCloseDelegate = borderCloseDelegate;
- borderLineThickness = borderInterface.BorderLineThickness;
GetDefaultLayer().Name = "OriginalRootLayer";
else
{
borderInterface.OnMaximize(IsMaximized());
- WindowSize += new Size2D((int)borderInterface.BorderLineThickness * 2, (int)(borderHeight + borderInterface.BorderLineThickness * 2));
+ if (borderHeight > 0)
+ {
+ borderLineThickness = borderInterface.BorderLineThickness;
+ WindowSize += new Size2D((int)borderLineThickness * 2, (int)(borderHeight + borderLineThickness * 2));
+ }
}
// If it is BorderResizePolicyType.KeepRatio type, it will be resized according to the ratio.
BackgroundColor = Color.Transparent,
};
- ushort padding = (ushort) borderInterface.BorderLineThickness;
+ ushort padding = (ushort) borderLineThickness;
borderView = new BorderView()
{
GrabTouchAfterLeave = true,
direction = BorderDirection.BottomLeft;
}
// check bottom right corner
- else if (xPosition > WindowSize.Width + (float)(borderInterface.BorderLineThickness * 2) - borderInterface.TouchThickness && yPosition > WindowSize.Height + borderHeight - borderInterface.TouchThickness)
+ else if (xPosition > WindowSize.Width + (float)(borderLineThickness * 2) - borderInterface.TouchThickness && yPosition > WindowSize.Height + borderHeight - borderInterface.TouchThickness)
{
direction = BorderDirection.BottomRight;
}
direction = BorderDirection.TopLeft;
}
// check top right corner
- else if (xPosition > WindowSize.Width + (float)(borderInterface.BorderLineThickness * 2) - borderInterface.TouchThickness && yPosition < borderInterface.TouchThickness)
+ else if (xPosition > WindowSize.Width + (float)(borderLineThickness * 2) - borderInterface.TouchThickness && yPosition < borderInterface.TouchThickness)
{
direction = BorderDirection.TopRight;
}
direction = BorderDirection.Left;
}
// check right side
- else if (xPosition > WindowSize.Width + (float)(borderInterface.BorderLineThickness * 2) - borderInterface.TouchThickness)
+ else if (xPosition > WindowSize.Width + (float)(borderLineThickness * 2) - borderInterface.TouchThickness)
{
direction = BorderDirection.Right;
}
// check bottom side
- else if (yPosition > WindowSize.Height + borderHeight + borderInterface.BorderLineThickness - borderInterface.TouchThickness)
+ else if (yPosition > WindowSize.Height + borderHeight + borderLineThickness - borderInterface.TouchThickness)
{
direction = BorderDirection.Bottom;
}
if (isMaximized == false)
{
- width = (float)(borderInterface.BorderLineThickness * 2);
- height += (float)(borderInterface.BorderLineThickness * 2);
- y += borderInterface.BorderLineThickness;
+ width = (float)(borderLineThickness * 2);
+ height += (float)(borderLineThickness * 2);
+ y += borderLineThickness;
}
Interop.ActorInternal.SetSize(GetBorderWindowRootLayer().SwigCPtr, resizeWidth, resizeHeight);
Interop.ActorInternal.SetParentOrigin(borderWindowBottomLayer.SwigCPtr, topCentor.SwigCPtr);
Interop.Actor.SetAnchorPoint(borderWindowBottomLayer.SwigCPtr, topCentor.SwigCPtr);
Interop.Actor.Add(rootLayer.SwigCPtr, borderWindowBottomLayer.SwigCPtr);
- Interop.ActorInternal.SetSize(borderWindowBottomLayer.SwigCPtr, WindowSize.Width + (float)(borderInterface.BorderLineThickness * 2), WindowSize.Height + (float)(borderInterface.BorderLineThickness * 2));
+ Interop.ActorInternal.SetSize(borderWindowBottomLayer.SwigCPtr, WindowSize.Width + (float)(borderLineThickness * 2), WindowSize.Height + (float)(borderLineThickness * 2));
borderWindowBottomLayer.SetWindow(this);
borderWindowBottomLayer.LowerToBottom();
Interop.ActorInternal.SetParentOrigin(borderWindowRootLayer.SwigCPtr, topCentor.SwigCPtr);
Interop.Actor.SetAnchorPoint(borderWindowRootLayer.SwigCPtr, topCentor.SwigCPtr);
Interop.Actor.Add(rootLayer.SwigCPtr, borderWindowRootLayer.SwigCPtr);
- Interop.ActorInternal.SetSize(borderWindowRootLayer.SwigCPtr, WindowSize.Width, WindowSize.Height - borderHeight - borderInterface.BorderLineThickness * 2);
+ Interop.ActorInternal.SetSize(borderWindowRootLayer.SwigCPtr, WindowSize.Width, WindowSize.Height - borderHeight - borderLineThickness * 2);
float height = (hasTopView == true) ? topView.SizeHeight : 0;
- Interop.ActorInternal.SetPosition(borderWindowRootLayer.SwigCPtr, 0, height + borderInterface.BorderLineThickness);
+ Interop.ActorInternal.SetPosition(borderWindowRootLayer.SwigCPtr, 0, height + borderLineThickness);
using PropertyValue propertyValue = new Tizen.NUI.PropertyValue((int)Tizen.NUI.ClippingModeType.ClipToBoundingBox);
Tizen.NUI.Object.SetProperty(borderWindowRootLayer.SwigCPtr, Tizen.NUI.BaseComponents.View.Property.ClippingMode, propertyValue);
{
if (isBorderWindow == true)
{
- var height = (ushort)(size.GetHeight() + borderHeight + borderInterface.BorderLineThickness * 2);
- var width = (ushort)(size.GetWidth() + borderInterface.BorderLineThickness * 2);
+ var height = (ushort)(size.GetHeight() + borderHeight + borderLineThickness * 2);
+ var width = (ushort)(size.GetWidth() + borderLineThickness * 2);
size.SetHeight(height);
size.SetWidth(width);
}
{
if (isBorderWindow == true && !(borderInterface.OverlayMode == true && IsMaximized() == true))
{
- var borderLine = IsMaximized() == true ? 0 : borderInterface.BorderLineThickness * 2;
+ var borderLine = IsMaximized() == true ? 0 : borderLineThickness * 2;
var height = (ushort)(size.GetHeight() - borderHeight - borderLine);
var width = (ushort)(size.GetWidth() - borderLine);
size.SetHeight(height);