// Copyright Epic Games, Inc. All Rights Reserved. #pragma once #include "CoreMinimal.h" #include "IPropertyTypeCustomization.h" #include "Layout/Visibility.h" #include "Math/Vector2D.h" #include "PropertyHandle.h" #include "Templates/SharedPointer.h" class IPropertyHandle; class SErrorText; class DETAILCUSTOMIZATIONS_API FSlateBrushStructCustomization : public IPropertyTypeCustomization { public: static TSharedRef MakeInstance(bool bIncludePreview); FSlateBrushStructCustomization(bool bIncludePreview); /** IPropertyTypeCustomization interface */ virtual void CustomizeHeader( TSharedRef StructPropertyHandle, class FDetailWidgetRow& HeaderRow, IPropertyTypeCustomizationUtils& StructCustomizationUtils ) override; virtual void CustomizeChildren( TSharedRef StructPropertyHandle, class IDetailChildrenBuilder& StructBuilder, IPropertyTypeCustomizationUtils& StructCustomizationUtils ) override; private: /** * Get the Slate Brush outline settings property row visibility */ EVisibility GetOutlineSettingsPropertyVisibility() const; /** * Get the Slate Brush tiling property row visibility */ EVisibility GetTilingPropertyVisibility() const; /** * Get the Slate Brush margin property row visibility */ EVisibility GetMarginPropertyVisibility() const; /** Callback for determining image size reset button visibility */ bool IsImageSizeResetToDefaultVisible(TSharedPtr PropertyHandle) const; /** Callback for clicking the image size reset button */ void OnImageSizeResetToDefault(TSharedPtr PropertyHandle) const; /** Gets the current default image size based on the current texture resource */ FVector2f GetDefaultImageSize() const; /** Slate Brush DrawAs property */ TSharedPtr DrawAsProperty; /** Slate Brush Image Size property */ TSharedPtr ImageSizeProperty; /** Slate Brush Resource Object property */ TSharedPtr ResourceObjectProperty; /** Slate Brush Resource Name property */ TSharedPtr ResourceNameProperty; /** Slate Brush Image Type property */ TSharedPtr ImageTypeProperty; /** Error text to display if the resource object is not valid*/ TSharedPtr ResourceErrorText; /** Should we show the preview portion of the customization? */ bool bIncludePreview; };