Skip to content

Commit b44e376

Browse files
empty2filljwindgassen
authored andcommitted
Add Removes Element button on Class Naming Conventions
1 parent d7c4a23 commit b44e376

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Plugins/Linter/Source/Linter/Private/LinterNamingConvention.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,21 @@ void FLinterNamingConventionDetails::CustomizeDetails(class IDetailLayoutBuilder
2626

2727
void FLinterNamingConventionDetails::OnGenerateElementForDetails(TSharedRef<IPropertyHandle> StructProperty, int32 ElementIndex, IDetailChildrenBuilder& ChildrenBuilder, IDetailLayoutBuilder* DetailLayout)
2828
{
29+
TSharedRef<SWidget> RemoveButton = PropertyCustomizationHelpers::MakeRemoveButton(FSimpleDelegate::CreateLambda([this, DetailLayout, ElementIndex] {
30+
TSharedRef<IPropertyHandle> NamingConventionsProperty = DetailLayout->GetProperty(GET_MEMBER_NAME_CHECKED(ULinterNamingConvention, ClassNamingConventions), ULinterNamingConvention::StaticClass());
31+
TSharedPtr<IPropertyHandleArray> NamingConventionsPropertyHandle = NamingConventionsProperty->AsArray();
32+
NamingConventionsPropertyHandle->DeleteItem(ElementIndex);
33+
}));
34+
2935
ChildrenBuilder.AddCustomRow(FText::GetEmpty())
3036
[
3137
SNew(SHorizontalBox)
3238
+ SHorizontalBox::Slot()
39+
.AutoWidth()
40+
[
41+
RemoveButton
42+
]
43+
+ SHorizontalBox::Slot()
3344
.FillWidth(1.0f)
3445
[
3546
SNew(SProperty, StructProperty->GetChildHandle("SoftClassPtr"))

0 commit comments

Comments
 (0)