From 68397f74e6d1bccd5d47e713e9cd7799e2b444bb Mon Sep 17 00:00:00 2001 From: Jamie Greunbaum Date: Sun, 1 Oct 2023 17:40:40 -0400 Subject: [PATCH] Fixed up the layout of the combo graph nodes, so that they arrange horizontally instead of vertically. --- .../Private/Ed/SEdComboActionGraphNode.cpp | 356 +----------------- 1 file changed, 17 insertions(+), 339 deletions(-) diff --git a/Source/ComboInputEditor/Private/Ed/SEdComboActionGraphNode.cpp b/Source/ComboInputEditor/Private/Ed/SEdComboActionGraphNode.cpp index c6b173d..66215ea 100644 --- a/Source/ComboInputEditor/Private/Ed/SEdComboActionGraphNode.cpp +++ b/Source/ComboInputEditor/Private/Ed/SEdComboActionGraphNode.cpp @@ -225,30 +225,19 @@ void SEdComboActionGraphNode::UpdateGraphNode() // Pins and node details + SOverlay::Slot() - .HAlign(EHorizontalAlignment::HAlign_Fill) + .HAlign(EHorizontalAlignment::HAlign_Center) .VAlign(EVerticalAlignment::VAlign_Fill) [ - SNew(SVerticalBox) + SNew(SHorizontalBox) // INPUT PIN AREA - + SVerticalBox::Slot() - .AutoHeight() + + SHorizontalBox::Slot() + .AutoWidth() [ - SNew(SBox) - .MinDesiredHeight(NodePadding.Top) - [ - SAssignNew(this->LeftNodeBox, SVerticalBox) - ] + SAssignNew(this->LeftNodeBox, SVerticalBox) ] - + SVerticalBox::Slot() - .AutoHeight() - [ - SNew(SSpacer) - .Size(FVector2D(0.f, 10.f)) - ] - - + SVerticalBox::Slot() + + SHorizontalBox::Slot() .Padding(FMargin(NodePadding.Left, 0.0f, NodePadding.Right, 0.0f)) .VAlign(EVerticalAlignment::VAlign_Fill) [ @@ -256,7 +245,7 @@ void SEdComboActionGraphNode::UpdateGraphNode() + SVerticalBox::Slot() .AutoHeight() [ - SAssignNew(NodeBody, SBorder) + SAssignNew(this->NodeBody, SBorder) .BorderImage(this, &SEdComboActionGraphNode::GetTextNodeTypeBrush) .BorderBackgroundColor(this, &SEdComboActionGraphNode::GetNodeTitleBackgroundColor) .HAlign(EHorizontalAlignment::HAlign_Fill) @@ -264,7 +253,7 @@ void SEdComboActionGraphNode::UpdateGraphNode() .Visibility(EVisibility::SelfHitTestInvisible) [ SNew(SBox) - .MinDesiredWidth(FOptionalSize(145.f)) + //.MinDesiredWidth(FOptionalSize(145.f)) [ SNew(SVerticalBox) @@ -404,316 +393,6 @@ void SEdComboActionGraphNode::UpdateGraphNode() ] ] #pragma endregion - -//#pragma region ImplementsOnly -// // IMPLEMENTS ONLY -// + SVerticalBox::Slot() -// + SVerticalBox::Slot() -// .AutoHeight() -// .HAlign(HAlign_Fill) -// .VAlign(VAlign_Fill) -// .Padding(FMargin(8.0f, 0.f, 8.0f, 0.f)) -// [ -// SNew(SBox) -// .Visibility(this, &SEdComboActionGraphNode::ShowImplementsOnlySlot_Unified) -// .MaxDesiredWidth(FOptionalSize(130.f)) -// .HAlign(HAlign_Fill) -// [ -// SNew(SGridPanel) -// .Visibility(EVisibility::HitTestInvisible) -// .FillColumn(0, 2.f) -// .FillColumn(1, 1.f) -//#pragma region Title -// + SGridPanel::Slot(0,0) -// .HAlign(HAlign_Fill) -// [ -// SNew(STextBlock) -// .Text(LOCTEXT("A", "DECORATORS")) -// .Font(FCoreStyle::GetDefaultFontStyle("Bold", 8)) -// .ColorAndOpacity(DefaultFontColor) -// ] -//#pragma endregion -// -//#pragma region Implements -// + SGridPanel::Slot(0,1) -// .HAlign(HAlign_Fill) -// .Padding(UnifiedRowsPadding) -// [ -// SNew(SBox) -// .Visibility(this, &SEdComboActionGraphNode::ShowImplementsOnlySlot_Unified) -// .HAlign(HAlign_Left) -// [ -// SNew(SScaleBox) -// .Stretch(EStretch::ScaleToFit) -// [ -// SNew(SHorizontalBox) -// +SHorizontalBox::Slot() -// .HAlign(HAlign_Fill) -// .VAlign(VAlign_Center) -// [ -// SNew(SScaleBox) -// .HAlign(HAlign_Left) -// .VAlign(VAlign_Center) -// .Stretch(EStretch::ScaleToFit) -// [ -// SNew(SBox) -// .MaxAspectRatio(FOptionalSize(1)) -// .MaxDesiredHeight(FOptionalSize(6.f)) -// .MaxDesiredWidth(FOptionalSize(6.f)) -// [ -// SNew(SImage) -// .Image(this, &SEdComboActionGraphNode::GetBulletPointImageBrush) -// .ColorAndOpacity(this, &SEdComboActionGraphNode::GetBulletPointsImagePointColor) -// ] -// ] -// ] -// -// +SHorizontalBox::Slot() -// [ -// SNew(SSpacer) -// .Size(FVector2D(1.f, 0.f)) -// ] -// -// +SHorizontalBox::Slot() -// .HAlign(HAlign_Fill) -// .AutoWidth() -// [ -// SNew(STextBlock) -// .Text(LOCTEXT("C", "implements")) -// .Font(FCoreStyle::GetDefaultFontStyle("Regular", 8)) -// .Justification(ETextJustify::Left) -// .ColorAndOpacity(this, &SEdComboActionGraphNode::GetImplementsRowColor) -// ] -// ] -// ] -// ] -// + SGridPanel::Slot(1,1) -// .HAlign(HAlign_Right) -// .VAlign(VAlign_Center) -// .Padding(UnifiedRowsPadding) -// [ -// SNew(SOverlay) -// +SOverlay::Slot() -// [ -// SNew(SScaleBox) -// .Stretch(EStretch::ScaleToFit) -// .HAlign(HAlign_Center) -// [ -// SNew(SBox) -// .Visibility(this, &SEdComboActionGraphNode::ShowImplementsOnlySlot_Unified) -// .MaxAspectRatio(FOptionalSize(1)) -// .MaxDesiredHeight(FOptionalSize(12.f)) -// .MaxDesiredWidth(FOptionalSize(12.f)) -// .WidthOverride(12.f) -// ] -// ] -// -// +SOverlay::Slot() -// .HAlign(HAlign_Center) -// [ -// SNew(STextBlock) -// .Text(this, &SEdComboActionGraphNode::GetNumberOfDecorators) -// .Font(FCoreStyle::GetDefaultFontStyle("Regular", 8)) -// .ColorAndOpacity(this, &SEdComboActionGraphNode::GetImplementsRowColor) -// .Justification(ETextJustify::Center) -// ] -// ] -//#pragma endregion -// ] -// ] -//#pragma endregion - -#pragma region Both - // BOTH - + SVerticalBox::Slot() - .AutoHeight() - .HAlign(EHorizontalAlignment::HAlign_Fill) - .VAlign(EVerticalAlignment::VAlign_Fill) - .Padding(FMargin(8.0f, 0.f, 8.0f, 0.f)) - [ - SNew(SBox) - .Visibility(this, &SEdComboActionGraphNode::ShowAllDecorators) - .MaxDesiredWidth(FOptionalSize(130.f)) - .HAlign(HAlign_Fill) - [ - SNew(SGridPanel) - .Visibility(EVisibility::HitTestInvisible) - .FillColumn(0, 2.f) - .FillColumn(1, 1.f) -//#pragma region Title -// + SGridPanel::Slot(0,0) -// .HAlign(HAlign_Fill) -// [ -// SNew(STextBlock) -// .Text(LOCTEXT("A", "DECORATORS")) -// .Font(FCoreStyle::GetDefaultFontStyle("Bold", 8)) -// .ColorAndOpacity(DefaultFontColor) -// ] -//#pragma endregion - -//#pragma region Inherits -// + SGridPanel::Slot(0,1) -// .HAlign(HAlign_Fill) -// .Padding(UnifiedRowsPadding) -// [ -// SNew(SBox) -// .Visibility(this, &SEdComboActionGraphNode::ShowAllDecorators) -// .HAlign(HAlign_Left) -// [ -// SNew(SScaleBox) -// .Stretch(EStretch::ScaleToFit) -// [ -// SNew(SHorizontalBox) -// +SHorizontalBox::Slot() -// .HAlign(HAlign_Fill) -// .VAlign(VAlign_Center) -// [ -// SNew(SScaleBox) -// .HAlign(HAlign_Left) -// .VAlign(VAlign_Center) -// .Stretch(EStretch::ScaleToFit) -// [ -// SNew(SBox) -// .MaxAspectRatio(FOptionalSize(1)) -// .MaxDesiredHeight(FOptionalSize(6.f)) -// .MaxDesiredWidth(FOptionalSize(6.f)) -// [ -// SNew(SImage) -// .Image(this, &SEdComboActionGraphNode::GetBulletPointImageBrush) -// ] -// ] -// ] -// -// +SHorizontalBox::Slot() -// [ -// SNew(SSpacer) -// .Size(FVector2D(1.f, 0.f)) -// ] -// -// +SHorizontalBox::Slot() -// .HAlign(HAlign_Fill) -// .AutoWidth() -// [ -// SNew(STextBlock) -// .Text(LOCTEXT("B", "inherits")) -// .Font(FCoreStyle::GetDefaultFontStyle("Regular", 8)) -// .Justification(ETextJustify::Left) -// .ColorAndOpacity(DefaultFontColor) -// ] -// ] -// ] -// ] -// + SGridPanel::Slot(1,1) -// .HAlign(HAlign_Right) -// .VAlign(VAlign_Center) -// .Padding(UnifiedRowsPadding) -// [ -// SNew(SScaleBox) -// .Stretch(EStretch::ScaleToFit) -// .HAlign(HAlign_Center) -// [ -// SNew(SBox) -// .Visibility(this, &SEdComboActionGraphNode::ShowAllDecorators) -// .MaxAspectRatio(FOptionalSize(1)) -// .MaxDesiredHeight(FOptionalSize(12.f)) -// .MaxDesiredWidth(FOptionalSize(12.f)) -// [ -// SNew(SImage) -// .Image(this, &SEdComboActionGraphNode::GetInheritsImageBrush) -// .ColorAndOpacity(this, &SEdComboActionGraphNode::GetInheritsImageTint) -// ] -// ] -// ] -//#pragma endregion - -//#pragma region Implements -// + SGridPanel::Slot(0,2) -// .HAlign(HAlign_Fill) -// .Padding(UnifiedRowsPadding) -// [ -// SNew(SBox) -// .Visibility(this, &SEdComboActionGraphNode::ShowAllDecorators) -// .HAlign(HAlign_Left) -// [ -// SNew(SScaleBox) -// .Stretch(EStretch::ScaleToFit) -// [ -// SNew(SHorizontalBox) -// +SHorizontalBox::Slot() -// .HAlign(HAlign_Fill) -// .VAlign(VAlign_Center) -// [ -// SNew(SScaleBox) -// .HAlign(HAlign_Left) -// .VAlign(VAlign_Center) -// .Stretch(EStretch::ScaleToFit) -// [ -// SNew(SBox) -// .MaxAspectRatio(FOptionalSize(1)) -// .MaxDesiredHeight(FOptionalSize(6.f)) -// .MaxDesiredWidth(FOptionalSize(6.f)) -// [ -// SNew(SImage) -// .Image(this, &SEdComboActionGraphNode::GetBulletPointImageBrush) -// .ColorAndOpacity(this, &SEdComboActionGraphNode::GetBulletPointsImagePointColor) -// ] -// ] -// ] -// -// +SHorizontalBox::Slot() -// [ -// SNew(SSpacer) -// .Size(FVector2D(1.f, 0.f)) -// ] -// -// +SHorizontalBox::Slot() -// .HAlign(HAlign_Fill) -// .AutoWidth() -// [ -// SNew(STextBlock) -// .Text(LOCTEXT("C", "implements")) -// .Font(FCoreStyle::GetDefaultFontStyle("Regular", 8)) -// .Justification(ETextJustify::Left) -// .ColorAndOpacity(this, &SEdComboActionGraphNode::GetImplementsRowColor) -// ] -// ] -// ] -// ] -// + SGridPanel::Slot(1,2) -// .HAlign(HAlign_Right) -// .VAlign(VAlign_Center) -// .Padding(UnifiedRowsPadding) -// [ -// SNew(SOverlay) -// +SOverlay::Slot() -// [ -// SNew(SScaleBox) -// .Stretch(EStretch::ScaleToFit) -// .HAlign(HAlign_Center) -// [ -// SNew(SBox) -// .Visibility(this, &SEdComboActionGraphNode::ShowAllDecorators) -// .MaxAspectRatio(FOptionalSize(1)) -// .MaxDesiredHeight(FOptionalSize(12.f)) -// .MaxDesiredWidth(FOptionalSize(12.f)) -// .WidthOverride(12.f) -// ] -// ] -// -// +SOverlay::Slot() -// .HAlign(HAlign_Center) -// [ -// SNew(STextBlock) -// .Text(this, &SEdComboActionGraphNode::GetNumberOfDecorators) -// .Font(FCoreStyle::GetDefaultFontStyle("Regular", 8)) -// .ColorAndOpacity(this, &SEdComboActionGraphNode::GetImplementsRowColor) -// .Justification(ETextJustify::Center) -// ] -// ] -//#pragma endregion - ] - ] -#pragma endregion + SVerticalBox::Slot() .HAlign(EHorizontalAlignment::HAlign_Center) .VAlign(EVerticalAlignment::VAlign_Fill) @@ -729,26 +408,25 @@ void SEdComboActionGraphNode::UpdateGraphNode() ] ] - + SVerticalBox::Slot() - .AutoHeight() + + SHorizontalBox::Slot() + .AutoWidth() [ SNew(SSpacer) - .Size(FVector2D(0.f, 10.f)) + .Size(FVector2D(0.0f, 10.0f)) ] // OUTPUT PIN AREA - + SVerticalBox::Slot() - .AutoHeight() + + SHorizontalBox::Slot() + .AutoWidth() + .Padding(20.0f, 0.0f) [ - SNew(SBox) - .MinDesiredHeight(NodePadding.Bottom) + SNew(SVerticalBox) + + SVerticalBox::Slot() [ SAssignNew(this->RightNodeBox, SVerticalBox) + SVerticalBox::Slot() .HAlign(EHorizontalAlignment::HAlign_Fill) - .VAlign(EVerticalAlignment::VAlign_Fill) - .Padding(20.0f, 0.0f) - .FillHeight(1.0f) + .VAlign(EVerticalAlignment::VAlign_Center) [ SAssignNew(this->OutputPinBox, SHorizontalBox) ]