Hello,
Learning slate C++ UI and I’m curious why the following isn’t working as expected.
I am imagining a Button that is auto-sized width but is a fixed height of 100 units alongside a green image of 200x200.
For some reason the button overrideheight isn’t working though. It’s height is instead autoresized to the text size. What am I missing?
TSharedRef<SDockTab> FHeightmapPluginModule::OnSpawnPluginTab(const FSpawnTabArgs& SpawnTabArgs)
{
return SNew(SDockTab)
.TabRole(ETabRole::NomadTab)
[
// Put your tab content here!
SNew(SBox)
.HAlign(HAlign_Left)
.VAlign(VAlign_Top)
[
SNew(SHorizontalBox)
+ SHorizontalBox::Slot()
[
SNew( SBox )
[
SNew( SButton )
.ForegroundColor( FLinearColor::Gray )
.Text( LOCTEXT( "GenerateHeightmap", "Generate Heightmap" ) )
.OnClicked_Raw( this, &FHeightmapPluginModule::OnBrowseClicked )
]
.HeightOverride( 100 )
.HAlign( HAlign_Fill )
.VAlign( VAlign_Top )
]
+ SHorizontalBox::Slot()
[
SNew( SImage ).Image( new FSlateColorBrush( FColor::Green )).DesiredSizeOverride( FVector2D( 200, 200 ))
]
]
];
}