Skip to content

Text image button

cpp
SNew(SButton)
.ToolTipText(LOCTEXT("key_CustomTextBtn", "Custom Text Btn"))
.ContentPadding(FMargin(0, 5.f, 0, 4.f))
.Content()
[
    SNew(SHorizontalBox)
    +SHorizontalBox::Slot()
    .HAlign(HAlign_Center)
    .VAlign(VAlign_Center)
    [
        SNew(SImage)
        .ColorAndOpacity(FSlateColor::UseForeground())
        .Image(FAppStyle::Get().GetBrush("Icons.Settings"))
    ]

    + SHorizontalBox::Slot()
    .Padding(FMargin(3, 0, 0, 0))
    .VAlign(VAlign_Center)
    .AutoWidth()
    [
        SNew(STextBlock)
        .TextStyle(FAppStyle::Get(), "SmallButtonText")
        .Text(FText::FromString("AUTO"))
    ]
]

Text Image Button