|
7 | 7 | #include "IContentBrowserSingleton.h" |
8 | 8 | #include "HAL/PlatformApplicationMisc.h" |
9 | 9 | #include "Internationalization/StringTable.h" |
| 10 | +#include "Slate/Private/Framework/Docking/SDockingArea.h" |
10 | 11 | #include "Widgets/Input/SSearchBox.h" |
11 | 12 |
|
12 | 13 | void SCoincidenceWidget::Construct(const FArguments& InArgs) |
@@ -274,7 +275,6 @@ FReply SCoincidenceWidget::OnStringTableMouseButtonUp(const FGeometry& Geometry, |
274 | 275 | return FReply::Unhandled(); |
275 | 276 | } |
276 | 277 |
|
277 | | -//TODO: Fix problem with finding row in StringTable |
278 | 278 | FReply SCoincidenceWidget::OnElementMouseDoubleClick(const FGeometry& Geometry, const FPointerEvent& MouseEvent, FString Key) const |
279 | 279 | { |
280 | 280 | if (MouseEvent.GetEffectingButton() == EKeys::LeftMouseButton) |
@@ -304,40 +304,75 @@ FReply SCoincidenceWidget::OnElementMouseDoubleClick(const FGeometry& Geometry, |
304 | 304 | EditorWindow = Window; |
305 | 305 | break; |
306 | 306 | } |
| 307 | + else |
| 308 | + { |
| 309 | + TFunction<void(const TSharedRef<SWidget>&)> FindDockTabsRecursive; |
| 310 | + |
| 311 | + FindDockTabsRecursive = [&](const TSharedRef<SWidget>& Widget) |
| 312 | + { |
| 313 | + if (Widget->GetTypeAsString() == "SDockTab") |
| 314 | + { |
| 315 | + TSharedRef<const SDockTab> DockTab = StaticCastSharedRef<const SDockTab>(Widget); |
| 316 | + FString TabText = DockTab->GetTabLabel().ToString(); |
| 317 | + |
| 318 | + UE_LOG(LogTemp, Warning, TEXT("%s"), *TabText ); |
| 319 | + |
| 320 | + if (TabText.Contains(AssetData->AssetName.ToString())) |
| 321 | + { |
| 322 | + UE_LOG(LogTemp, Warning, TEXT("%s"), *DockTab->GetTabLabel().ToString() ); |
| 323 | + EditorWindow = Window; |
| 324 | + return; |
| 325 | + } |
| 326 | + } |
| 327 | + const FChildren* Children = Widget->GetChildren(); |
| 328 | + if (Children) |
| 329 | + { |
| 330 | + for (int32 i = 0; i < Children->Num(); ++i) |
| 331 | + { |
| 332 | + TSharedRef<SWidget> Child = ConstCastSharedRef<SWidget>(Children->GetChildAt(i)); |
| 333 | + FindDockTabsRecursive(Child); |
| 334 | + } |
| 335 | + } |
| 336 | + }; |
| 337 | + |
| 338 | + FindDockTabsRecursive(Window); |
| 339 | + |
| 340 | + if (EditorWindow != nullptr) break; |
| 341 | + } |
307 | 342 | } |
308 | | - } |
309 | 343 |
|
310 | | - if (EditorWindow.IsValid()) |
311 | | - { |
312 | | - TSharedPtr<SWidget> FoundSearchBox; |
| 344 | + if (EditorWindow.IsValid()) |
| 345 | + { |
| 346 | + TSharedPtr<SWidget> FoundSearchBox; |
313 | 347 |
|
314 | | - TFunction<void(TSharedRef<SWidget>)> WidgetSearch = [&](const TSharedRef<SWidget>& Widget) |
315 | | - { |
316 | | - if (!FoundSearchBox.IsValid() && Widget->GetTypeAsString() == "SSearchBox") |
317 | | - { |
318 | | - FoundSearchBox = Widget; |
319 | | - } |
| 348 | + TFunction<void(TSharedRef<SWidget>)> WidgetSearch = [&](const TSharedRef<SWidget>& Widget) |
| 349 | + { |
| 350 | + if (!FoundSearchBox.IsValid() && Widget->GetTypeAsString() == "SSearchBox") |
| 351 | + { |
| 352 | + FoundSearchBox = Widget; |
| 353 | + } |
320 | 354 |
|
321 | | - if (!FoundSearchBox.IsValid()) |
322 | | - { |
323 | | - FChildren* Children = Widget->GetChildren(); |
324 | | - for (int32 i = 0; i < Children->Num() && !FoundSearchBox.IsValid(); ++i) |
325 | | - { |
326 | | - WidgetSearch(Children->GetChildAt(i)); |
327 | | - } |
328 | | - } |
329 | | - }; |
| 355 | + if (!FoundSearchBox.IsValid()) |
| 356 | + { |
| 357 | + FChildren* Children = Widget->GetChildren(); |
| 358 | + for (int32 i = 0; i < Children->Num() && !FoundSearchBox.IsValid(); ++i) |
| 359 | + { |
| 360 | + WidgetSearch(Children->GetChildAt(i)); |
| 361 | + } |
| 362 | + } |
| 363 | + }; |
330 | 364 |
|
331 | | - WidgetSearch(EditorWindow.ToSharedRef()); |
| 365 | + WidgetSearch(EditorWindow.ToSharedRef()); |
332 | 366 |
|
333 | | - if (FoundSearchBox.IsValid()) |
334 | | - { |
335 | | - if (TSharedPtr<SSearchBox> SearchBox = StaticCastSharedPtr<SSearchBox>(FoundSearchBox)) |
336 | | - { |
337 | | - SearchBox->SetText(FText::FromString(Key)); |
338 | | - } |
339 | | - } |
340 | | - } |
| 367 | + if (FoundSearchBox.IsValid()) |
| 368 | + { |
| 369 | + if (TSharedPtr<SSearchBox> SearchBox = StaticCastSharedPtr<SSearchBox>(FoundSearchBox)) |
| 370 | + { |
| 371 | + SearchBox->SetText(FText::FromString(Key)); |
| 372 | + } |
| 373 | + } |
| 374 | + } |
| 375 | + } |
341 | 376 | } |
342 | 377 | } |
343 | 378 | } |
|
0 commit comments