How to make SWrapBox
use its parent’s size as the preferred size? So that if I change the window size, it automatically re-arrange its children.
I looked into the code and it seems like it’s being constructed with a default value of 100
if the parameter is not specified, and it does not seem to support what I want.
/*SWrapBox.h*/
SLATE_BEGIN_ARGS(SWrapBox)
: _PreferredWidth(100.f)
, _PreferredSize(100.f) //default value here
, _InnerSlotPadding(FVector2D::ZeroVector)
, _UseAllottedWidth(false)
, _UseAllottedSize(false)
, _Orientation(EOrientation::Orient_Horizontal)
{
_Visibility = EVisibility::SelfHitTestInvisible;
}