I’m making a simple dialog window implementation by creating a SCompoundWidget-based widget.
It’s declared like this:
ChildSlot
.VAlign(VAlign_Fill)
.HAlign(HAlign_Fill)
[
SNew(SVerticalBox)
+ SVerticalBox::Slot()
.MaxHeight(32.f)
[
TitleContainer.ToSharedRef()
]
+ SVerticalBox::Slot()
.VAlign(VAlign_Fill)
[
SNew(SBorder)
.BorderImage(&WindowStyle->ContentBoxBrush)
.Content()
[
SNew(SVerticalBox)
+ SVerticalBox::Slot()
.VAlign(VAlign_Center)
.HAlign(HAlign_Center)
[
ConfirmTextBlock.ToSharedRef()
]
+ SVerticalBox::Slot()
.VAlign(VAlign_Center)
.HAlign(HAlign_Center)
[
SNew(SHorizontalBox)
+ SHorizontalBox::Slot()
.HAlign(HAlign_Right)
.Padding(10)
[
SNew(SButton)
.ButtonStyle(&WindowStyle->OKButtonStyle)
]
+ SHorizontalBox::Slot()
.HAlign(HAlign_Left)
.Padding(10)
[
SNew(SButton)
.ButtonStyle(&WindowStyle->CancelButtonStyle)
]
]
]
]
];
But the 2nd slot of top-level Vertical Box (window contents) doesn’t fill the remaining space of widget’s Childslot
As you can see a bit less than a half of widget space for contents is empty. What should be the proper declaration to make this work?