Files
UnrealEngineUWP/Engine/Source/Editor/PropertyEditor/Private/DetailCustomBuilderRow.h
sebastian nordgren b2dd11e5ae Fixed issues while searching details panels (most notably Project Settings) introduced by change 19171653.
Fixed crash when accessing and invalid PropertyEditor in FDetailPropertyRow.

Fixed performance issue caused by calling GetWidgetRow() on FDetailPropertyRow for every row, which caused the row's widgets to be constructed again when filtering.

Added GetCustomResetToDefault() to IDetailLayoutRow, which allows us to bypass the performance penalty of creating the WidgetRow by directly accessing the FResetToDefaultOverride of the row.

#jira UE-144131
#rb paul.chipchase
#preflight 621de59f037be0078cecb0e4
#preflight 621df0563e14f0c7e5276836

[CL 19196340 by sebastian nordgren in ue5-main branch]
2022-03-01 05:20:41 -05:00

50 lines
1.8 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "Misc/Attribute.h"
#include "DetailWidgetRow.h"
#include "SDetailsViewBase.h"
#include "DetailCategoryBuilder.h"
class FCustomChildrenBuilder;
class FDetailCategoryImpl;
class FDetailItemNode;
class IDetailCustomNodeBuilder;
class FDetailCustomBuilderRow : public IDetailLayoutRow, public TSharedFromThis<FDetailCustomBuilderRow>
{
public:
FDetailCustomBuilderRow( TSharedRef<IDetailCustomNodeBuilder> CustomBuilder );
virtual ~FDetailCustomBuilderRow() {}
/** IDetailLayoutRow interface */
virtual FName GetRowName() const override { return GetCustomBuilderName(); }
virtual TOptional<FResetToDefaultOverride> GetCustomResetToDefault() const override;
void Tick( float DeltaTime );
bool RequiresTick() const;
bool HasColumns() const;
bool ShowOnlyChildren() const;
void OnItemNodeInitialized( TSharedRef<FDetailItemNode> InTreeNode, TSharedRef<FDetailCategoryImpl> InParentCategory, const TAttribute<bool>& InIsParentEnabled );
TSharedRef<IDetailCustomNodeBuilder> GetCustomBuilder() const { return CustomNodeBuilder; }
FName GetCustomBuilderName() const;
TSharedPtr<IPropertyHandle> GetPropertyHandle() const;
void OnGenerateChildren( FDetailNodeList& OutChildren );
bool IsInitiallyCollapsed() const;
TSharedPtr<FDetailWidgetRow> GetWidgetRow() const;
bool AreChildCustomizationsHidden() const;
void SetOriginalPath(FStringView Path) { OriginalPath = Path; }
const FString& GetOriginalPath() const { return OriginalPath; }
private:
/** Whether or not our parent is enabled */
TAttribute<bool> IsParentEnabled;
TSharedPtr<FDetailWidgetRow> HeaderRow;
TSharedRef<class IDetailCustomNodeBuilder> CustomNodeBuilder;
TSharedPtr<class FCustomChildrenBuilder> ChildrenBuilder;
TWeakPtr<FDetailCategoryImpl> ParentCategory;
FString OriginalPath;
};