SNew(SHorizontalBox)
+SHorizontalBox::Slot()
.VAlign(VAlign_Center)
.HAlign(HAlign_Center) // add this
.AutoWidth() // and let this slot's width == inner button's width
.Padding(0.0f, 0.0f, 2.0f, 0.0f)
[
SNew(SButton)
]
+SHorizontalBox::Slot()
.VAlign(VAlign_Center)
.HAlign(HAlign_Fill) // then let this fulfill all the rest width
[
SNew(SButton)
]
If u wanna 1 HorizontalBox contains 2 button, one button has a small width, and another fulfill the rest spaces, u can try this.