From a71a5746ccd6734a68b8c592cab757879993301f Mon Sep 17 00:00:00 2001
From: sphrose <82213493+sphrose@users.noreply.github.com>
Date: Tue, 13 Apr 2021 17:15:10 +0100
Subject: [PATCH 1/8] [LY-113714] Jira: LY-113714
https://jira.agscollab.com/browse/LY-113714
---
.../Serialization/EditContextConstants.inl | 2 +
.../Components/img/UI20/line.svg | 7 ++++
.../AzQtComponents/Components/resources.qrc | 1 +
.../UI/PropertyEditor/PropertyRowWidget.cpp | 37 ++++++++++++++++++-
.../UI/PropertyEditor/PropertyRowWidget.hxx | 8 ++++
Code/Sandbox/Editor/Style/Editor.qss | 5 +++
Gems/Vegetation/Code/Source/Descriptor.cpp | 2 +
7 files changed, 61 insertions(+), 1 deletion(-)
create mode 100644 Code/Framework/AzQtComponents/AzQtComponents/Components/img/UI20/line.svg
diff --git a/Code/Framework/AzCore/AzCore/Serialization/EditContextConstants.inl b/Code/Framework/AzCore/AzCore/Serialization/EditContextConstants.inl
index d4658d4e8c..de67013741 100644
--- a/Code/Framework/AzCore/AzCore/Serialization/EditContextConstants.inl
+++ b/Code/Framework/AzCore/AzCore/Serialization/EditContextConstants.inl
@@ -62,6 +62,8 @@ namespace AZ
const static AZ::Crc32 ButtonTooltip = AZ_CRC("ButtonTooltip", 0x1605a7d2);
const static AZ::Crc32 CheckboxTooltip = AZ_CRC("CheckboxTooltip", 0x1159eb78);
const static AZ::Crc32 CheckboxDefaultValue = AZ_CRC("CheckboxDefaultValue", 0x03f117e6);
+ //! Emboldens the text and adds a line above this item within the RPE.
+ const static AZ::Crc32 RPESectionSeparator = AZ_CRC("RPESectionSeparator", 0xc6249a95);
//! Affects the display order of a node relative to it's parent/children. Higher values display further down (after) lower values. Default is 0, negative values are allowed. Must be applied as an attribute to the EditorData element
const static AZ::Crc32 DisplayOrder = AZ_CRC("DisplayOrder", 0x23660ec2);
//! Specifies whether the UI should support multi-edit for aggregate instances of this property
diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Components/img/UI20/line.svg b/Code/Framework/AzQtComponents/AzQtComponents/Components/img/UI20/line.svg
new file mode 100644
index 0000000000..60f7c07c8d
--- /dev/null
+++ b/Code/Framework/AzQtComponents/AzQtComponents/Components/img/UI20/line.svg
@@ -0,0 +1,7 @@
+
+
\ No newline at end of file
diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Components/resources.qrc b/Code/Framework/AzQtComponents/AzQtComponents/Components/resources.qrc
index 77dead96a1..decc1bd72f 100644
--- a/Code/Framework/AzQtComponents/AzQtComponents/Components/resources.qrc
+++ b/Code/Framework/AzQtComponents/AzQtComponents/Components/resources.qrc
@@ -627,6 +627,7 @@
img/UI20/Settings.svg
img/UI20/Asset_Folder.svg
img/UI20/Asset_File.svg
+ img/UI20/line.svg
img/UI20/AssetEditor/default_document.svg
diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyRowWidget.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyRowWidget.cpp
index 8c371baf8c..a16c1f7480 100644
--- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyRowWidget.cpp
+++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyRowWidget.cpp
@@ -44,6 +44,24 @@ namespace AzToolsFramework
m_iconOpen = s_iconOpen;
m_iconClosed = s_iconClosed;
+ m_outerLayout = new QVBoxLayout(nullptr);
+ m_outerLayout->setSpacing(0);
+ m_outerLayout->setContentsMargins(0, 0, 0, 0);
+
+ // separatorLayout will contain a spacer and a separator line. The width of the spacer is adjusted later to ensure the line is the
+ // correct length.
+ QHBoxLayout* separatorLayout = new QHBoxLayout(nullptr);
+ m_outerLayout->addLayout(separatorLayout);
+
+ m_separatorIndent = new QSpacerItem(1, 1);
+ separatorLayout->addItem(m_separatorIndent);
+
+ m_separatorLine.load(QStringLiteral(":/Gallery/line.svg"));
+ m_separatorLine.setFixedHeight(3);
+
+ separatorLayout->addWidget(&m_separatorLine);
+ m_separatorLine.setVisible(false);
+
m_mainLayout = new QHBoxLayout();
m_mainLayout->setSpacing(0);
m_mainLayout->setContentsMargins(0, 1, 0, 1);
@@ -118,7 +136,8 @@ namespace AzToolsFramework
m_handler = nullptr;
m_containerSize = 0;
- setLayout(m_mainLayout);
+ m_outerLayout->addLayout(m_mainLayout);
+ setLayout(m_outerLayout);
}
bool PropertyRowWidget::HasChildWidgetAlready() const
@@ -301,6 +320,9 @@ namespace AzToolsFramework
}
}
+ m_isSectionSeparator = false;
+ m_separatorLine.setVisible(false);
+
RefreshAttributesFromNode(true);
// --------------------- HANDLER discovery:
@@ -946,6 +968,11 @@ namespace AzToolsFramework
{
HandleChangeNotifyAttribute(reader, m_sourceNode ? m_sourceNode->GetParent() : nullptr, m_editingCompleteNotifiers);
}
+ else if (attributeName == AZ::Edit::Attributes::RPESectionSeparator)
+ {
+ m_separatorLine.setVisible(true);
+ m_isSectionSeparator = true;
+ }
}
void PropertyRowWidget::SetReadOnlyQueryFunction(const ReadOnlyQueryFunction& readOnlyQueryFunction)
@@ -1070,6 +1097,7 @@ namespace AzToolsFramework
{
m_dropDownArrow->hide();
}
+ m_separatorIndent->changeSize((m_treeDepth * m_treeIndentation) + m_leafIndentation, 1, QSizePolicy::Fixed, QSizePolicy::Fixed);
m_indent->changeSize((m_treeDepth * m_treeIndentation) + m_leafIndentation, 1, QSizePolicy::Fixed, QSizePolicy::Fixed);
m_leftHandSideLayout->invalidate();
m_leftHandSideLayout->update();
@@ -1085,6 +1113,7 @@ namespace AzToolsFramework
connect(m_dropDownArrow, &QCheckBox::clicked, this, &PropertyRowWidget::OnClickedExpansionButton);
}
m_dropDownArrow->show();
+ m_separatorIndent->changeSize((m_treeDepth * m_treeIndentation), 1, QSizePolicy::Fixed, QSizePolicy::Fixed);
m_indent->changeSize((m_treeDepth * m_treeIndentation), 1, QSizePolicy::Fixed, QSizePolicy::Fixed);
m_leftHandSideLayout->invalidate();
m_leftHandSideLayout->update();
@@ -1095,6 +1124,7 @@ namespace AzToolsFramework
void PropertyRowWidget::SetIndentSize(int w)
{
+ m_separatorIndent->changeSize(w, 1, QSizePolicy::Fixed, QSizePolicy::Fixed);
m_indent->changeSize(w, 1, QSizePolicy::Fixed, QSizePolicy::Fixed);
m_leftHandSideLayout->invalidate();
m_leftHandSideLayout->update();
@@ -1318,6 +1348,11 @@ namespace AzToolsFramework
return canBeTopLevel(this);
}
+ bool PropertyRowWidget::IsSectionSeparator() const
+ {
+ return m_isSectionSeparator;
+ }
+
bool PropertyRowWidget::GetAppendDefaultLabelToName()
{
return false;
diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyRowWidget.hxx b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyRowWidget.hxx
index e4b538ccdc..af1b68b66f 100644
--- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyRowWidget.hxx
+++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyRowWidget.hxx
@@ -25,6 +25,7 @@ AZ_PUSH_DISABLE_WARNING(4251, "-Wunknown-warning-option") // class '...' needs t
#include
#include
#include
+#include
#include
AZ_POP_DISABLE_WARNING
@@ -44,6 +45,7 @@ namespace AzToolsFramework
Q_PROPERTY(bool hasChildRows READ HasChildRows);
Q_PROPERTY(bool isTopLevel READ IsTopLevel);
Q_PROPERTY(int getLevel READ GetLevel);
+ Q_PROPERTY(bool isSectionSeparator READ IsSectionSeparator);
Q_PROPERTY(bool appendDefaultLabelToName READ GetAppendDefaultLabelToName WRITE AppendDefaultLabelToName)
public:
AZ_CLASS_ALLOCATOR(PropertyRowWidget, AZ::SystemAllocator, 0)
@@ -82,6 +84,7 @@ namespace AzToolsFramework
PropertyRowWidget* GetParentRow() const { return m_parentRow; }
int GetLevel() const;
bool IsTopLevel() const;
+ bool IsSectionSeparator() const;
// Remove the default label and append the text to the name label.
bool GetAppendDefaultLabelToName();
@@ -161,6 +164,9 @@ namespace AzToolsFramework
QHBoxLayout* m_leftHandSideLayout;
QHBoxLayout* m_middleLayout;
QHBoxLayout* m_rightHandSideLayout;
+ QVBoxLayout* m_outerLayout;
+ QSvgWidget m_separatorLine;
+ QSpacerItem* m_separatorIndent;
QPointer m_dropDownArrow;
QPointer m_containerClearButton;
@@ -229,6 +235,8 @@ namespace AzToolsFramework
int m_treeIndentation = 14;
int m_leafIndentation = 16;
+ bool m_isSectionSeparator = false;
+
QIcon m_iconOpen;
QIcon m_iconClosed;
diff --git a/Code/Sandbox/Editor/Style/Editor.qss b/Code/Sandbox/Editor/Style/Editor.qss
index 0c3f64b85c..7887560105 100644
--- a/Code/Sandbox/Editor/Style/Editor.qss
+++ b/Code/Sandbox/Editor/Style/Editor.qss
@@ -38,6 +38,11 @@ AzToolsFramework--ComponentPaletteWidget > QTreeView
background-color: #222222;
}
+AzToolsFramework--PropertyRowWidget[isSectionSeparator="true"] QLabel#Name
+{
+ font-weight: bold;
+}
+
/* Style for visualizing property values overridden from their prefab values */
AzToolsFramework--PropertyRowWidget[IsOverridden=true] #Name QLabel,
AzToolsFramework--ComponentEditorHeader #Title[IsOverridden="true"]
diff --git a/Gems/Vegetation/Code/Source/Descriptor.cpp b/Gems/Vegetation/Code/Source/Descriptor.cpp
index 93a301f073..4fd1037f09 100644
--- a/Gems/Vegetation/Code/Source/Descriptor.cpp
+++ b/Gems/Vegetation/Code/Source/Descriptor.cpp
@@ -170,6 +170,8 @@ namespace Vegetation
{
edit->Class(
"Vegetation Descriptor", "Details used to create vegetation instances")
+ ->ClassElement(AZ::Edit::ClassElements::EditorData, "")
+ ->Attribute(AZ::Edit::Attributes::RPESectionSeparator, true)
// For this ComboBox to actually work, there is a PropertyHandler registration in EditorVegetationSystemComponent.cpp
->DataElement(AZ::Edit::UIHandlers::ComboBox, &Descriptor::m_spawnerType, "Instance Spawner", "The type of instances to spawn")
->Attribute(AZ::Edit::Attributes::GenericValueList, &Descriptor::GetSpawnerTypeList)
From a94700786133526d14971bddfdd87e5d989d8678 Mon Sep 17 00:00:00 2001
From: sphrose <82213493+sphrose@users.noreply.github.com>
Date: Wed, 14 Apr 2021 15:15:42 +0100
Subject: [PATCH 2/8] Darken line
---
.../AzQtComponents/AzQtComponents/Components/img/UI20/line.svg | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Components/img/UI20/line.svg b/Code/Framework/AzQtComponents/AzQtComponents/Components/img/UI20/line.svg
index 60f7c07c8d..fe01efddba 100644
--- a/Code/Framework/AzQtComponents/AzQtComponents/Components/img/UI20/line.svg
+++ b/Code/Framework/AzQtComponents/AzQtComponents/Components/img/UI20/line.svg
@@ -2,6 +2,6 @@
\ No newline at end of file
From 2dbd9e4a050e141a45c85a12b4d245f0695f581a Mon Sep 17 00:00:00 2001
From: sphrose <82213493+sphrose@users.noreply.github.com>
Date: Mon, 19 Apr 2021 15:54:41 +0100
Subject: [PATCH 3/8] Changed to use direct line drawing rather than adding
svg.
---
.../Components/img/UI20/line.svg | 7 ----
.../UI/PropertyEditor/PropertyRowWidget.cpp | 40 +++++++------------
.../UI/PropertyEditor/PropertyRowWidget.hxx | 4 +-
3 files changed, 16 insertions(+), 35 deletions(-)
delete mode 100644 Code/Framework/AzQtComponents/AzQtComponents/Components/img/UI20/line.svg
diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Components/img/UI20/line.svg b/Code/Framework/AzQtComponents/AzQtComponents/Components/img/UI20/line.svg
deleted file mode 100644
index fe01efddba..0000000000
--- a/Code/Framework/AzQtComponents/AzQtComponents/Components/img/UI20/line.svg
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
\ No newline at end of file
diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyRowWidget.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyRowWidget.cpp
index a16c1f7480..5b02e81e6d 100644
--- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyRowWidget.cpp
+++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyRowWidget.cpp
@@ -27,6 +27,7 @@ AZ_PUSH_DISABLE_WARNING(4244 4251 4800, "-Wunknown-warning-option") // 4244: con
#include
#include
#include
+#include
AZ_POP_DISABLE_WARNING
static const int LabelColumnStretch = 2;
@@ -44,24 +45,6 @@ namespace AzToolsFramework
m_iconOpen = s_iconOpen;
m_iconClosed = s_iconClosed;
- m_outerLayout = new QVBoxLayout(nullptr);
- m_outerLayout->setSpacing(0);
- m_outerLayout->setContentsMargins(0, 0, 0, 0);
-
- // separatorLayout will contain a spacer and a separator line. The width of the spacer is adjusted later to ensure the line is the
- // correct length.
- QHBoxLayout* separatorLayout = new QHBoxLayout(nullptr);
- m_outerLayout->addLayout(separatorLayout);
-
- m_separatorIndent = new QSpacerItem(1, 1);
- separatorLayout->addItem(m_separatorIndent);
-
- m_separatorLine.load(QStringLiteral(":/Gallery/line.svg"));
- m_separatorLine.setFixedHeight(3);
-
- separatorLayout->addWidget(&m_separatorLine);
- m_separatorLine.setVisible(false);
-
m_mainLayout = new QHBoxLayout();
m_mainLayout->setSpacing(0);
m_mainLayout->setContentsMargins(0, 1, 0, 1);
@@ -136,8 +119,20 @@ namespace AzToolsFramework
m_handler = nullptr;
m_containerSize = 0;
- m_outerLayout->addLayout(m_mainLayout);
- setLayout(m_outerLayout);
+ setLayout(m_mainLayout);
+ }
+
+ void PropertyRowWidget::paintEvent(QPaintEvent* event)
+ {
+ QStylePainter p(this);
+
+ if (IsSectionSeparator())
+ {
+ const QPen linePen(QColor(0x3B3E3F));
+ p.setPen(linePen);
+ int indent = m_treeDepth * m_treeIndentation;
+ p.drawLine(event->rect().topLeft() + QPoint(indent, 0), event->rect().topRight());
+ }
}
bool PropertyRowWidget::HasChildWidgetAlready() const
@@ -321,7 +316,6 @@ namespace AzToolsFramework
}
m_isSectionSeparator = false;
- m_separatorLine.setVisible(false);
RefreshAttributesFromNode(true);
@@ -970,7 +964,6 @@ namespace AzToolsFramework
}
else if (attributeName == AZ::Edit::Attributes::RPESectionSeparator)
{
- m_separatorLine.setVisible(true);
m_isSectionSeparator = true;
}
}
@@ -1097,7 +1090,6 @@ namespace AzToolsFramework
{
m_dropDownArrow->hide();
}
- m_separatorIndent->changeSize((m_treeDepth * m_treeIndentation) + m_leafIndentation, 1, QSizePolicy::Fixed, QSizePolicy::Fixed);
m_indent->changeSize((m_treeDepth * m_treeIndentation) + m_leafIndentation, 1, QSizePolicy::Fixed, QSizePolicy::Fixed);
m_leftHandSideLayout->invalidate();
m_leftHandSideLayout->update();
@@ -1113,7 +1105,6 @@ namespace AzToolsFramework
connect(m_dropDownArrow, &QCheckBox::clicked, this, &PropertyRowWidget::OnClickedExpansionButton);
}
m_dropDownArrow->show();
- m_separatorIndent->changeSize((m_treeDepth * m_treeIndentation), 1, QSizePolicy::Fixed, QSizePolicy::Fixed);
m_indent->changeSize((m_treeDepth * m_treeIndentation), 1, QSizePolicy::Fixed, QSizePolicy::Fixed);
m_leftHandSideLayout->invalidate();
m_leftHandSideLayout->update();
@@ -1124,7 +1115,6 @@ namespace AzToolsFramework
void PropertyRowWidget::SetIndentSize(int w)
{
- m_separatorIndent->changeSize(w, 1, QSizePolicy::Fixed, QSizePolicy::Fixed);
m_indent->changeSize(w, 1, QSizePolicy::Fixed, QSizePolicy::Fixed);
m_leftHandSideLayout->invalidate();
m_leftHandSideLayout->update();
diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyRowWidget.hxx b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyRowWidget.hxx
index af1b68b66f..d08779caa4 100644
--- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyRowWidget.hxx
+++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyRowWidget.hxx
@@ -129,6 +129,7 @@ namespace AzToolsFramework
void SetSelectionEnabled(bool selectionEnabled);
void SetSelected(bool selected);
bool eventFilter(QObject *watched, QEvent *event) override;
+ void paintEvent(QPaintEvent*) override;
/// Apply tooltip to widget and some of its children.
void SetDescription(const QString& text);
@@ -164,9 +165,6 @@ namespace AzToolsFramework
QHBoxLayout* m_leftHandSideLayout;
QHBoxLayout* m_middleLayout;
QHBoxLayout* m_rightHandSideLayout;
- QVBoxLayout* m_outerLayout;
- QSvgWidget m_separatorLine;
- QSpacerItem* m_separatorIndent;
QPointer m_dropDownArrow;
QPointer m_containerClearButton;
From b1d8330870f31399d05aa0c1d1b28e5f55512580 Mon Sep 17 00:00:00 2001
From: sphrose <82213493+sphrose@users.noreply.github.com>
Date: Tue, 20 Apr 2021 17:20:19 +0100
Subject: [PATCH 4/8] Review fixes.
---
.../AzQtComponents/AzQtComponents/Components/resources.qrc | 1 -
.../AzToolsFramework/UI/PropertyEditor/PropertyRowWidget.hxx | 1 -
2 files changed, 2 deletions(-)
diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Components/resources.qrc b/Code/Framework/AzQtComponents/AzQtComponents/Components/resources.qrc
index e253c6492d..f9e601fb6d 100644
--- a/Code/Framework/AzQtComponents/AzQtComponents/Components/resources.qrc
+++ b/Code/Framework/AzQtComponents/AzQtComponents/Components/resources.qrc
@@ -630,7 +630,6 @@
img/UI20/Settings.svg
img/UI20/Asset_Folder.svg
img/UI20/Asset_File.svg
- img/UI20/line.svg
img/UI20/AssetEditor/default_document.svg
diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyRowWidget.hxx b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyRowWidget.hxx
index d08779caa4..2fb695fca5 100644
--- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyRowWidget.hxx
+++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyRowWidget.hxx
@@ -25,7 +25,6 @@ AZ_PUSH_DISABLE_WARNING(4251, "-Wunknown-warning-option") // class '...' needs t
#include
#include
#include
-#include
#include
AZ_POP_DISABLE_WARNING
From 7eb6cc10b6559511927028d9f6c5514b973a99bb Mon Sep 17 00:00:00 2001
From: sphrose <82213493+sphrose@users.noreply.github.com>
Date: Wed, 5 May 2021 08:57:39 +0100
Subject: [PATCH 5/8] Made change affect all modifiable containers.
---
.../Serialization/EditContextConstants.inl | 2 --
.../UI/PropertyEditor/PropertyRowWidget.cpp | 22 +++++++++++++------
.../UI/PropertyEditor/PropertyRowWidget.hxx | 5 +++--
Gems/Vegetation/Code/Source/Descriptor.cpp | 2 --
4 files changed, 18 insertions(+), 13 deletions(-)
diff --git a/Code/Framework/AzCore/AzCore/Serialization/EditContextConstants.inl b/Code/Framework/AzCore/AzCore/Serialization/EditContextConstants.inl
index 481ae5a91c..90b9ba5afd 100644
--- a/Code/Framework/AzCore/AzCore/Serialization/EditContextConstants.inl
+++ b/Code/Framework/AzCore/AzCore/Serialization/EditContextConstants.inl
@@ -62,8 +62,6 @@ namespace AZ
const static AZ::Crc32 ButtonTooltip = AZ_CRC("ButtonTooltip", 0x1605a7d2);
const static AZ::Crc32 CheckboxTooltip = AZ_CRC("CheckboxTooltip", 0x1159eb78);
const static AZ::Crc32 CheckboxDefaultValue = AZ_CRC("CheckboxDefaultValue", 0x03f117e6);
- //! Emboldens the text and adds a line above this item within the RPE.
- const static AZ::Crc32 RPESectionSeparator = AZ_CRC("RPESectionSeparator", 0xc6249a95);
//! Affects the display order of a node relative to it's parent/children. Higher values display further down (after) lower values. Default is 0, negative values are allowed. Must be applied as an attribute to the EditorData element
const static AZ::Crc32 DisplayOrder = AZ_CRC("DisplayOrder", 0x23660ec2);
//! Specifies whether the UI should support multi-edit for aggregate instances of this property
diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyRowWidget.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyRowWidget.cpp
index 5b02e81e6d..faeae0a06d 100644
--- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyRowWidget.cpp
+++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyRowWidget.cpp
@@ -315,8 +315,6 @@ namespace AzToolsFramework
}
}
- m_isSectionSeparator = false;
-
RefreshAttributesFromNode(true);
// --------------------- HANDLER discovery:
@@ -962,10 +960,6 @@ namespace AzToolsFramework
{
HandleChangeNotifyAttribute(reader, m_sourceNode ? m_sourceNode->GetParent() : nullptr, m_editingCompleteNotifiers);
}
- else if (attributeName == AZ::Edit::Attributes::RPESectionSeparator)
- {
- m_isSectionSeparator = true;
- }
}
void PropertyRowWidget::SetReadOnlyQueryFunction(const ReadOnlyQueryFunction& readOnlyQueryFunction)
@@ -1340,7 +1334,7 @@ namespace AzToolsFramework
bool PropertyRowWidget::IsSectionSeparator() const
{
- return m_isSectionSeparator;
+ return CanBeReordered();
}
bool PropertyRowWidget::GetAppendDefaultLabelToName()
@@ -1686,6 +1680,20 @@ namespace AzToolsFramework
m_nameLabel->setFilter(m_currentFilterString);
}
+ bool PropertyRowWidget::CanChildrenBeReordered() const
+ {
+ return m_containerEditable;
+ }
+
+ bool PropertyRowWidget::CanBeReordered() const
+ {
+ if (!m_parentRow)
+ {
+ return false;
+ }
+
+ return m_parentRow->CanChildrenBeReordered();
+ }
}
#include "UI/PropertyEditor/moc_PropertyRowWidget.cpp"
diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyRowWidget.hxx b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyRowWidget.hxx
index 2fb695fca5..b6c94dc98b 100644
--- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyRowWidget.hxx
+++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyRowWidget.hxx
@@ -149,6 +149,9 @@ namespace AzToolsFramework
QLabel* GetNameLabel() { return m_nameLabel; }
void SetIndentSize(int w);
void SetAsCustom(bool custom) { m_custom = custom; }
+
+ bool CanChildrenBeReordered() const;
+ bool CanBeReordered() const;
protected:
int CalculateLabelWidth() const;
@@ -232,8 +235,6 @@ namespace AzToolsFramework
int m_treeIndentation = 14;
int m_leafIndentation = 16;
- bool m_isSectionSeparator = false;
-
QIcon m_iconOpen;
QIcon m_iconClosed;
diff --git a/Gems/Vegetation/Code/Source/Descriptor.cpp b/Gems/Vegetation/Code/Source/Descriptor.cpp
index 45ec25038d..ecda8415e7 100644
--- a/Gems/Vegetation/Code/Source/Descriptor.cpp
+++ b/Gems/Vegetation/Code/Source/Descriptor.cpp
@@ -170,8 +170,6 @@ namespace Vegetation
{
edit->Class(
"Vegetation Descriptor", "Details used to create vegetation instances")
- ->ClassElement(AZ::Edit::ClassElements::EditorData, "")
- ->Attribute(AZ::Edit::Attributes::RPESectionSeparator, true)
// For this ComboBox to actually work, there is a PropertyHandler registration in EditorVegetationSystemComponent.cpp
->DataElement(AZ::Edit::UIHandlers::ComboBox, &Descriptor::m_spawnerType, "Instance Spawner", "The type of instances to spawn")
->Attribute(AZ::Edit::Attributes::GenericValueList, &Descriptor::GetSpawnerTypeList)
From 7276253c4225dd09dc0208693815abffe7ac672c Mon Sep 17 00:00:00 2001
From: sphrose <82213493+sphrose@users.noreply.github.com>
Date: Tue, 11 May 2021 08:20:44 +0100
Subject: [PATCH 6/8] renamed function
---
.../AzToolsFramework/UI/PropertyEditor/PropertyRowWidget.cpp | 4 ++--
.../AzToolsFramework/UI/PropertyEditor/PropertyRowWidget.hxx | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyRowWidget.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyRowWidget.cpp
index faeae0a06d..85784d61e0 100644
--- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyRowWidget.cpp
+++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyRowWidget.cpp
@@ -126,7 +126,7 @@ namespace AzToolsFramework
{
QStylePainter p(this);
- if (IsSectionSeparator())
+ if (IsReorderableRow())
{
const QPen linePen(QColor(0x3B3E3F));
p.setPen(linePen);
@@ -1332,7 +1332,7 @@ namespace AzToolsFramework
return canBeTopLevel(this);
}
- bool PropertyRowWidget::IsSectionSeparator() const
+ bool PropertyRowWidget::IsReorderableRow() const
{
return CanBeReordered();
}
diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyRowWidget.hxx b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyRowWidget.hxx
index b6c94dc98b..58bf3bb9f0 100644
--- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyRowWidget.hxx
+++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyRowWidget.hxx
@@ -83,7 +83,7 @@ namespace AzToolsFramework
PropertyRowWidget* GetParentRow() const { return m_parentRow; }
int GetLevel() const;
bool IsTopLevel() const;
- bool IsSectionSeparator() const;
+ bool IsReorderableRow() const;
// Remove the default label and append the text to the name label.
bool GetAppendDefaultLabelToName();
From b08643d9da90d0215ed5b22efcc3716fdaa90622 Mon Sep 17 00:00:00 2001
From: sphrose <82213493+sphrose@users.noreply.github.com>
Date: Tue, 11 May 2021 11:24:51 +0100
Subject: [PATCH 7/8] Use renamed functions in stylesheet.
---
.../AzToolsFramework/UI/PropertyEditor/PropertyRowWidget.hxx | 2 +-
Code/Sandbox/Editor/Style/Editor.qss | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyRowWidget.hxx b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyRowWidget.hxx
index 58bf3bb9f0..1c17cab69f 100644
--- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyRowWidget.hxx
+++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyRowWidget.hxx
@@ -44,7 +44,7 @@ namespace AzToolsFramework
Q_PROPERTY(bool hasChildRows READ HasChildRows);
Q_PROPERTY(bool isTopLevel READ IsTopLevel);
Q_PROPERTY(int getLevel READ GetLevel);
- Q_PROPERTY(bool isSectionSeparator READ IsSectionSeparator);
+ Q_PROPERTY(bool canBeReordered READ CanBeReordered);
Q_PROPERTY(bool appendDefaultLabelToName READ GetAppendDefaultLabelToName WRITE AppendDefaultLabelToName)
public:
AZ_CLASS_ALLOCATOR(PropertyRowWidget, AZ::SystemAllocator, 0)
diff --git a/Code/Sandbox/Editor/Style/Editor.qss b/Code/Sandbox/Editor/Style/Editor.qss
index 7887560105..fa7d67dd43 100644
--- a/Code/Sandbox/Editor/Style/Editor.qss
+++ b/Code/Sandbox/Editor/Style/Editor.qss
@@ -38,7 +38,7 @@ AzToolsFramework--ComponentPaletteWidget > QTreeView
background-color: #222222;
}
-AzToolsFramework--PropertyRowWidget[isSectionSeparator="true"] QLabel#Name
+AzToolsFramework--PropertyRowWidget[canBeReordered="true"] QLabel#Name
{
font-weight: bold;
}
From 36a79aca8a353316f560f3079ff2b66cb5120996 Mon Sep 17 00:00:00 2001
From: sphrose <82213493+sphrose@users.noreply.github.com>
Date: Thu, 13 May 2021 10:56:39 +0100
Subject: [PATCH 8/8] Remove redundant function.
---
.../UI/PropertyEditor/PropertyRowWidget.cpp | 7 +------
.../UI/PropertyEditor/PropertyRowWidget.hxx | 1 -
2 files changed, 1 insertion(+), 7 deletions(-)
diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyRowWidget.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyRowWidget.cpp
index 85784d61e0..890253b528 100644
--- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyRowWidget.cpp
+++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyRowWidget.cpp
@@ -126,7 +126,7 @@ namespace AzToolsFramework
{
QStylePainter p(this);
- if (IsReorderableRow())
+ if (CanBeReordered())
{
const QPen linePen(QColor(0x3B3E3F));
p.setPen(linePen);
@@ -1332,11 +1332,6 @@ namespace AzToolsFramework
return canBeTopLevel(this);
}
- bool PropertyRowWidget::IsReorderableRow() const
- {
- return CanBeReordered();
- }
-
bool PropertyRowWidget::GetAppendDefaultLabelToName()
{
return false;
diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyRowWidget.hxx b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyRowWidget.hxx
index 1c17cab69f..79121403c9 100644
--- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyRowWidget.hxx
+++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyRowWidget.hxx
@@ -83,7 +83,6 @@ namespace AzToolsFramework
PropertyRowWidget* GetParentRow() const { return m_parentRow; }
int GetLevel() const;
bool IsTopLevel() const;
- bool IsReorderableRow() const;
// Remove the default label and append the text to the name label.
bool GetAppendDefaultLabelToName();