{
if (borderInterface != null)
{
+ if (borderLineThickness != borderInterface.BorderLineThickness)
+ {
+ int diffBorderLine = (int)borderInterface.BorderLineThickness - (int)borderLineThickness;
+ borderLineThickness = borderInterface.BorderLineThickness;
+
+ if (borderView != null)
+ {
+ Extents extents = borderView.Padding;
+ ushort start = (extents.Start + diffBorderLine) > 0 ? (ushort)(extents.Start + diffBorderLine) : (ushort)0;
+ ushort end = (extents.End + diffBorderLine) > 0 ? (ushort)(extents.End + diffBorderLine) : (ushort)0;
+ ushort top = (extents.Top + diffBorderLine) > 0 ? (ushort)(extents.Top + diffBorderLine) : (ushort)0;
+ ushort bottom = (extents.Bottom + diffBorderLine) > 0 ? (ushort)(extents.Bottom + diffBorderLine) : (ushort)0;
+ borderView.Padding = new Extents(start, end, top, bottom);
+ if (IsMaximized() == true)
+ {
+ borderView.OnMaximize(true);
+ }
+ }
+
+ 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 (hasTopView) height += topView.SizeHeight;
if (hasBottomView) height += bottomView.SizeHeight;
-
if (height != borderHeight)
{
float diff = height - borderHeight;
SetMimimumSize(mimimumSize);
minSize = borderInterface.MinSize;
}
+
if (maxSize != borderInterface.MaxSize)
{
using Size2D maximumSize = new Size2D((borderInterface.MaxSize?.Width + (int)borderInterface.BorderLineThickness * 2 ?? 0), (borderInterface.MaxSize?.Height ?? 0) + (int)(borderHeight + borderInterface.BorderLineThickness * 2));
SetMaximumSize(maximumSize);
maxSize = borderInterface.MaxSize;
}
+
if (borderResizePolicy != borderInterface.ResizePolicy)
{
AddAuxiliaryHint("wm.policy.win.resize_aspect_ratio", "0");
AddAuxiliaryHint("wm.policy.win.resize_aspect_ratio", "1");
}
}
- if (borderLineThickness != borderInterface.BorderLineThickness)
- {
- int diffBorderLine = (int)(borderInterface.BorderLineThickness - borderLineThickness);
- borderLineThickness = borderInterface.BorderLineThickness;
-
- if (borderView != null)
- {
- Extents extents = borderView.Padding;
- ushort start = (extents.Start + diffBorderLine) > 0 ? (ushort)(extents.Start + diffBorderLine) : (ushort)0;
- ushort end = (extents.End + diffBorderLine) > 0 ? (ushort)(extents.End + diffBorderLine) : (ushort)0;
- ushort top = (extents.Top + diffBorderLine) > 0 ? (ushort)(extents.Top + diffBorderLine) : (ushort)0;
- ushort bottom = (extents.Bottom + diffBorderLine) > 0 ? (ushort)(extents.Bottom + diffBorderLine) : (ushort)0;
- borderView.Padding = new Extents(start, end, top, bottom);
- if (IsMaximized() == true)
- {
- borderView.OnMaximize(true);
- }
- }
-
- ResizedEventArgs e = new ResizedEventArgs();
- e.WindowSize = WindowSize;
- windowResizeEventHandler?.Invoke(this, e);
- }
+
}
}
/// <summary>