Merge branch 'main' of https://github.com/aws-lumberyard/o3de into Spawnable/Instantiation/EntityIdReferenceFix
This commit is contained in:
+28
@@ -27,6 +27,7 @@ AZ_PUSH_DISABLE_WARNING(4244 4251 4800, "-Wunknown-warning-option") // 4244: con
|
||||
#include <QtGui/QTextLayout>
|
||||
#include <QtGui/QPainter>
|
||||
#include <QMessageBox>
|
||||
#include <QStylePainter>
|
||||
AZ_POP_DISABLE_WARNING
|
||||
|
||||
static const int LabelColumnStretch = 2;
|
||||
@@ -121,6 +122,19 @@ namespace AzToolsFramework
|
||||
setLayout(m_mainLayout);
|
||||
}
|
||||
|
||||
void PropertyRowWidget::paintEvent(QPaintEvent* event)
|
||||
{
|
||||
QStylePainter p(this);
|
||||
|
||||
if (CanBeReordered())
|
||||
{
|
||||
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
|
||||
{
|
||||
return m_childWidget != nullptr;
|
||||
@@ -1661,6 +1675,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"
|
||||
|
||||
+5
@@ -44,6 +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 canBeReordered READ CanBeReordered);
|
||||
Q_PROPERTY(bool appendDefaultLabelToName READ GetAppendDefaultLabelToName WRITE AppendDefaultLabelToName)
|
||||
public:
|
||||
AZ_CLASS_ALLOCATOR(PropertyRowWidget, AZ::SystemAllocator, 0)
|
||||
@@ -126,6 +127,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);
|
||||
@@ -146,6 +148,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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user