Changing the BorderView's SizeHeight should also change the Window size.
For this, we add an UpdateProperty() api.
{
if (borderInterface != null)
{
+ float height = 0;
+ if (isTop) height += topView.SizeHeight;
+ if (isBottom) height += bottomView.SizeHeight;
+
+ if (height != borderHeight)
+ {
+ float diff = height - borderHeight;
+ borderHeight = height;
+ WindowSize = new Size2D(WindowSize.Width, WindowSize.Height + (int)(diff));
+ }
+
if (minSize != borderInterface.MinSize)
{
using Size2D mimimumSize = new Size2D(borderInterface.MinSize.Width, borderInterface.MinSize.Height + (int)borderHeight);
/// The minimum size by which the window will small.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
- public Size2D MinSize
+ public Size2D MinSize
{
get
{
set
{
minSize = value;
- BorderWindow?.UpdateProperty();
+ UpdateProperty();
}
}
set
{
maxSize = value;
- BorderWindow?.UpdateProperty();
+ UpdateProperty();
}
}
set
{
resizePolicy = value;
- BorderWindow?.UpdateProperty();
+ UpdateProperty();
}
}
+ /// <summary>
+ /// Update properties
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public void UpdateProperty()
+ {
+ BorderWindow?.UpdateProperty();
+ }
+
/// <summary>
/// Creates a default border