Skip to content

Commit 42665fa

Browse files
committed
v1.0.1 - Code adaptation for ue4.27
1 parent bbc67e8 commit 42665fa

4 files changed

Lines changed: 46 additions & 49 deletions

File tree

Source/StringTableSearchPlugin/Private/SlateWidgets/CoincidenceWidget.cpp

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ void SCoincidenceWidget::Construct(const FArguments& InArgs)
2626
]
2727
];
2828

29-
MainBorderBrush->TintColor = FSlateColor(FLinearColor(FColor::FromHex(TEXT("2F2F2FFF"))));
30-
ElementBorderBrush->TintColor = FSlateColor(FLinearColor(FColor::FromHex(TEXT("242424FF"))));
29+
MainBorderBrush->TintColor = FSlateColor(FLinearColor(FColor::FromHex(TEXT("303030FF"))));
30+
ElementBorderBrush->TintColor = FSlateColor(FLinearColor(FColor::FromHex(TEXT("3E3E3EFF"))));
3131

3232
VerticalBox->AddSlot()
3333
[
@@ -47,29 +47,31 @@ void SCoincidenceWidget::Construct(const FArguments& InArgs)
4747
SNew(SHorizontalBox)
4848
+ SHorizontalBox::Slot()
4949
.AutoWidth()
50-
.Padding(5.f, 0.f, 0.f, 0.f)
50+
.Padding(9.f, 3.f, 0.f, 0.f)
5151
[
5252
SAssignNew(ExpanderArrow, SButton)
53-
.ButtonStyle(FCoreStyle::Get(), "NoBorder")
53+
.ButtonStyle( FCoreStyle::Get(), "NoBorder" )
5454
.VAlign(VAlign_Center)
5555
.HAlign(HAlign_Center)
5656
.ClickMethod(EButtonClickMethod::MouseDown)
5757
.OnClicked(this, &SCoincidenceWidget::OnExpanderClicked)
5858
.IsFocusable(false)
59+
.ContentPadding(0.f)
60+
.ForegroundColor( FSlateColor::UseForeground() )
5961
[
6062
SNew(SImage)
6163
.Image( this, &SCoincidenceWidget::GetExpanderImage)
62-
.ColorAndOpacity(FSlateColor::UseSubduedForeground())
64+
.ColorAndOpacity( FSlateColor::UseForeground() )
6365
]
6466
]
6567

6668
+ SHorizontalBox::Slot()
67-
.Padding(5.f, 0.f, 0.f, 0.f)
69+
.Padding(2.f, 0.f, 0.f, 0.f)
6870
.VAlign(VAlign_Center)
6971
[
7072
SNew(STextBlock)
7173
.Text(FText::FromString(InArgs._StringTablesWithCoincidence->AssetData->AssetName.ToString()))
72-
.TextStyle(FAppStyle::Get(), "DetailsView.CategoryTextStyle")
74+
.TextStyle(FEditorStyle::Get(), "DetailsView.CategoryTextStyle")
7375
.Justification(ETextJustify::Left)
7476
]
7577
]
@@ -95,7 +97,7 @@ void SCoincidenceWidget::Construct(const FArguments& InArgs)
9597
.Padding(FMargin(2.f, 0.f, 2.f, 1.f))
9698
[
9799
SNew(SSplitter)
98-
.Style(FAppStyle::Get(), "DetailsView.Splitter")
100+
.Style(FEditorStyle::Get(), "DetailsView.Splitter")
99101
.PhysicalSplitterHandleSize(1.0f)
100102
.HitDetectionSplitterHandleSize(10.0f)
101103
.Clipping(EWidgetClipping::ClipToBoundsAlways)
@@ -116,7 +118,6 @@ void SCoincidenceWidget::Construct(const FArguments& InArgs)
116118
.AutoWrapText(false)
117119
.WrapTextAt(0)
118120
.Clipping(EWidgetClipping::ClipToBounds)
119-
.OverflowPolicy(ETextOverflowPolicy::Ellipsis)
120121
]
121122
]
122123
+ SSplitter::Slot()
@@ -136,7 +137,6 @@ void SCoincidenceWidget::Construct(const FArguments& InArgs)
136137
.AutoWrapText(false)
137138
.WrapTextAt(0)
138139
.Clipping(EWidgetClipping::ClipToBounds)
139-
.OverflowPolicy(ETextOverflowPolicy::Ellipsis)
140140
]
141141
]
142142
]
@@ -189,7 +189,7 @@ const FSlateBrush* SCoincidenceWidget::GetExpanderImage() const
189189
}
190190
}
191191

192-
return FAppStyle::Get().GetBrush(ResourceName);
192+
return FEditorStyle::GetBrush(ResourceName);
193193
}
194194

195195
void SCoincidenceWidget::OnSlotResize(float FillCoefficient, int32 ColumnIndex) const
@@ -227,7 +227,7 @@ FReply SCoincidenceWidget::OnStringTableMouseButtonUp(const FGeometry& Geometry,
227227
MenuBuilder.AddMenuEntry(
228228
FText::FromString("Show in Folder View"),
229229
FText::FromString("Selects the folder that contains this asset in the Content Browser Sources Panel."),
230-
FSlateIcon(FAppStyle::Get().GetStyleSetName(), "ContentBrowser.TabIcon"),
230+
FSlateIcon(FEditorStyle::GetStyleSetName(), "ContentBrowser.TabIcon"),
231231
FUIAction(FExecuteAction::CreateLambda([this]()
232232
{
233233
TArray<UObject*> AssetsToFind;
@@ -241,7 +241,7 @@ FReply SCoincidenceWidget::OnStringTableMouseButtonUp(const FGeometry& Geometry,
241241
MenuBuilder.AddMenuEntry(
242242
FText::FromString("Copy StringTable Name"),
243243
FText::FromString("Copy the selected StringTable Name"),
244-
FSlateIcon(FAppStyle::Get().GetStyleSetName(), "GenericCommands.Copy"),
244+
FSlateIcon(FCoreStyle::Get().GetStyleSetName(), "GenericCommands.Copy"),
245245
FUIAction(FExecuteAction::CreateLambda([this]()
246246
{
247247
FPlatformApplicationMisc::ClipboardCopy(*AssetData->AssetName.ToString());
@@ -251,7 +251,7 @@ FReply SCoincidenceWidget::OnStringTableMouseButtonUp(const FGeometry& Geometry,
251251
MenuBuilder.AddMenuEntry(
252252
FText::FromString("Copy StringTable Reference"),
253253
FText::FromString("Copy the selected StringTable Reference"),
254-
FSlateIcon(FAppStyle::Get().GetStyleSetName(), "GenericCommands.Copy"),
254+
FSlateIcon(FCoreStyle::Get().GetStyleSetName(), "GenericCommands.Copy"),
255255
FUIAction(FExecuteAction::CreateLambda([this]()
256256
{
257257
FPlatformApplicationMisc::ClipboardCopy(*FString::Printf(TEXT("%s'%s'"),
@@ -274,6 +274,7 @@ FReply SCoincidenceWidget::OnStringTableMouseButtonUp(const FGeometry& Geometry,
274274
return FReply::Unhandled();
275275
}
276276

277+
//TODO: Fix problem with finding row in StringTable
277278
FReply SCoincidenceWidget::OnElementMouseDoubleClick(const FGeometry& Geometry, const FPointerEvent& MouseEvent, FString Key) const
278279
{
279280
if (MouseEvent.GetEffectingButton() == EKeys::LeftMouseButton)
@@ -354,7 +355,7 @@ FReply SCoincidenceWidget::OnElementMouseButtonUp(const FGeometry& Geometry, con
354355
MenuBuilder.AddMenuEntry(
355356
FText::FromString("Copy Key"),
356357
FText::FromString("Copy the selected Key"),
357-
FSlateIcon(FAppStyle::Get().GetStyleSetName(), "GenericCommands.Copy"),
358+
FSlateIcon(FCoreStyle::Get().GetStyleSetName(), "GenericCommands.Copy"),
358359
FUIAction(FExecuteAction::CreateLambda([this, Pair]()
359360
{
360361
FPlatformApplicationMisc::ClipboardCopy(*Pair.Key);
@@ -364,7 +365,7 @@ FReply SCoincidenceWidget::OnElementMouseButtonUp(const FGeometry& Geometry, con
364365
MenuBuilder.AddMenuEntry(
365366
FText::FromString("Copy Source String"),
366367
FText::FromString("Copy the selected Source String"),
367-
FSlateIcon(FAppStyle::Get().GetStyleSetName(), "GenericCommands.Copy"),
368+
FSlateIcon(FCoreStyle::Get().GetStyleSetName(), "GenericCommands.Copy"),
368369
FUIAction(FExecuteAction::CreateLambda([this, Pair]()
369370
{
370371
FPlatformApplicationMisc::ClipboardCopy(*Pair.Value);
@@ -374,7 +375,7 @@ FReply SCoincidenceWidget::OnElementMouseButtonUp(const FGeometry& Geometry, con
374375
MenuBuilder.AddMenuEntry(
375376
FText::FromString("Copy Row Reference"),
376377
FText::FromString("Copy the selected Row Reference"),
377-
FSlateIcon(FAppStyle::Get().GetStyleSetName(), "GenericCommands.Copy"),
378+
FSlateIcon(FCoreStyle::Get().GetStyleSetName(), "GenericCommands.Copy"),
378379
FUIAction(FExecuteAction::CreateLambda([this, Pair]()
379380
{
380381
FPlatformApplicationMisc::ClipboardCopy(*FString::Printf(TEXT("LOCTABLE(\"%s\", \"%s\")"),

Source/StringTableSearchPlugin/Private/SlateWidgets/SearchInStringTablesWidget.cpp

Lines changed: 26 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -24,44 +24,39 @@ void SSearchInStringTablesWidget::Construct(const FArguments& InArgs)
2424
{
2525
this->ChildSlot
2626
[
27-
SNew(SBorder)
28-
.BorderImage(FAppStyle::Get().GetBrush("Brushes.Panel"))
27+
SNew(SVerticalBox)
28+
+SVerticalBox::Slot()
29+
.AutoHeight()
30+
.Padding(0.f, 0.f, 0.f, 4.f)
2931
[
30-
SNew(SVerticalBox)
31-
+SVerticalBox::Slot()
32-
.AutoHeight()
33-
.Padding(8.f, 5.f, 8.f, 5.f)
32+
SNew(SBox)
33+
.HeightOverride(20.f)
3434
[
35-
SNew(SBox)
36-
.HeightOverride(26.f)
35+
SNew(SHorizontalBox)
36+
+SHorizontalBox::Slot()
37+
.FillWidth(1)
3738
[
38-
SNew(SHorizontalBox)
39-
+SHorizontalBox::Slot()
40-
.FillWidth(1)
41-
[
42-
SNew(SSearchBox)
43-
.HintText(FText::FromString(TEXT("Enter Key or Source String to find references...")))
44-
.OnTextChanged(this, &SSearchInStringTablesWidget::OnSearchTextChanged)
45-
.OnTextCommitted(this, &SSearchInStringTablesWidget::OnSearchTextCommitted)
46-
.DelayChangeNotificationsWhileTyping(false)
47-
]
39+
SNew(SSearchBox)
40+
.HintText(FText::FromString(TEXT("Enter Key or Source String to find references...")))
41+
.OnTextChanged(this, &SSearchInStringTablesWidget::OnSearchTextChanged)
42+
.OnTextCommitted(this, &SSearchInStringTablesWidget::OnSearchTextCommitted)
43+
.DelayChangeNotificationsWhileTyping(false)
4844
]
4945
]
50-
+SVerticalBox::Slot()
51-
.FillHeight(1.0f)
46+
]
47+
+SVerticalBox::Slot()
48+
.FillHeight(1.0f)
49+
[
50+
SNew(SBorder)
51+
.BorderImage(FEditorStyle::GetBrush("Menu.Background"))
52+
.Padding(FMargin(8.f, 8.f, 4.f, 0.f))
5253
[
53-
SNew(SBorder)
54-
.BorderImage(FAppStyle::Get().GetBrush("Brushes.Recessed"))
55-
.Padding(FMargin(8.f, 8.f, 4.f, 0.f))
56-
[
57-
SAssignNew(ResultsContainer, SModifiedScrollBox)
58-
]
54+
SAssignNew(ResultsContainer, SModifiedScrollBox)
5955
]
60-
61-
+SVerticalBox::Slot()
62-
.AutoHeight()
63-
.Padding( FMargin( 0.f, 8.f ) )
6456
]
57+
/*+SVerticalBox::Slot()
58+
.AutoHeight()
59+
.Padding( FMargin( 0.f, 8.f ) )*/
6560
];
6661
}
6762

@@ -100,7 +95,7 @@ void SSearchInStringTablesWidget::OnSearchTextCommitted( const FText& Text, ETex
10095
return true;
10196
});
10297

103-
if (!Coincidences.IsEmpty())
98+
if (Coincidences.Num() > 0)
10499
{
105100
StringTablesWithCoincidences.SetNum(StringTablesWithCoincidences.Num() + 1);
106101

Source/StringTableSearchPlugin/Private/StringTableSearchPlugin.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ void FStringTableSearchPluginModule::RegisterSearchInStringTables()
2323
FOnSpawnTab::CreateRaw(this, &FStringTableSearchPluginModule::OnSpawnSearchInStringTablesTab))
2424
.SetDisplayName(FText::FromString(TEXT("Search in StringTables")))
2525
.SetGroup(WorkspaceMenu::GetMenuStructure().GetToolsCategory())
26-
.SetIcon(FSlateIcon(FAppStyle::GetAppStyleSetName(), "Icons.Search"));
26+
.SetIcon(FSlateIcon(FEditorStyle::GetStyleSetName(), "Kismet.Tabs.FindResults"));
2727
}
2828

2929
TSharedRef<SDockTab> FStringTableSearchPluginModule::OnSpawnSearchInStringTablesTab(const FSpawnTabArgs& SpawnTabArgs)

Source/StringTableSearchPlugin/StringTableSearchPlugin.Build.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ public StringTableSearchPlugin(ReadOnlyTargetRules Target) : base(Target)
4242
"InputCore",
4343
"UnrealEd",
4444
"ApplicationCore",
45+
"EditorStyle"
4546
// ... add private dependencies that you statically link with here ...
4647
}
4748
);

0 commit comments

Comments
 (0)