Changing material inspector to use indicator icons instead of highlighting modified properties

Added a blank placeholder image to account for changes to indention when indicator icons are active
Added parameter to inspector constructor for specifying leaf property indention size

Signed-off-by: Guthrie Adams <guthadam@amazon.com>
monroegm-disable-blank-issue-2
Guthrie Adams 4 years ago
parent d827db741d
commit 7c2464ad15

@ -1102,10 +1102,7 @@ namespace AzToolsFramework
{ {
m_dropDownArrow->hide(); m_dropDownArrow->hide();
} }
m_indent->changeSize((m_treeDepth * m_treeIndentation) + m_leafIndentation, 1, QSizePolicy::Fixed, QSizePolicy::Fixed); SetIndentSize(m_treeDepth * m_treeIndentation + m_leafIndentation);
m_leftHandSideLayout->invalidate();
m_leftHandSideLayout->update();
m_leftHandSideLayout->activate();
} }
else else
{ {
@ -1117,10 +1114,7 @@ namespace AzToolsFramework
connect(m_dropDownArrow, &QCheckBox::clicked, this, &PropertyRowWidget::OnClickedExpansionButton); connect(m_dropDownArrow, &QCheckBox::clicked, this, &PropertyRowWidget::OnClickedExpansionButton);
} }
m_dropDownArrow->show(); m_dropDownArrow->show();
m_indent->changeSize((m_treeDepth * m_treeIndentation), 1, QSizePolicy::Fixed, QSizePolicy::Fixed); SetIndentSize(m_treeDepth * m_treeIndentation);
m_leftHandSideLayout->invalidate();
m_leftHandSideLayout->update();
m_leftHandSideLayout->activate();
m_dropDownArrow->setChecked(m_expanded); m_dropDownArrow->setChecked(m_expanded);
} }
} }
@ -1720,10 +1714,9 @@ namespace AzToolsFramework
} }
else else
{ {
m_indicatorButton->setVisible(true);
QPixmap pixmap(imagePath); QPixmap pixmap(imagePath);
m_indicatorButton->setIcon(pixmap); m_indicatorButton->setIcon(pixmap);
m_indicatorButton->setVisible(true);
}; };
} }

@ -1,5 +1,6 @@
<RCC> <RCC>
<qresource prefix="/PropertyEditor/Resources"> <qresource prefix="/PropertyEditor/Resources">
<file>blank.png</file>
<file>point_hand.png</file> <file>point_hand.png</file>
<file>cross-circle-small.png</file> <file>cross-circle-small.png</file>
<file>cross-small.png</file> <file>cross-small.png</file>

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:81b5fa1f978888c3be8a40fce20455668df2723a77587aeb7039f8bf74bdd0e3
size 119

@ -42,7 +42,8 @@ namespace AtomToolsFramework
QWidget* parent = {}, QWidget* parent = {},
const AZ::u32 saveStateKey = {}, const AZ::u32 saveStateKey = {},
const AzToolsFramework::InstanceDataHierarchy::ValueComparisonFunction& valueComparisonFunction = {}, const AzToolsFramework::InstanceDataHierarchy::ValueComparisonFunction& valueComparisonFunction = {},
const AzToolsFramework::IndicatorQueryFunction& indicatorQueryFunction = {}); const AzToolsFramework::IndicatorQueryFunction& indicatorQueryFunction = {},
int leafIndentSize = 16);
void Refresh() override; void Refresh() override;
void Rebuild() override; void Rebuild() override;

@ -20,7 +20,8 @@ namespace AtomToolsFramework
QWidget* parent, QWidget* parent,
const AZ::u32 saveStateKey, const AZ::u32 saveStateKey,
const AzToolsFramework::InstanceDataHierarchy::ValueComparisonFunction& valueComparisonFunction, const AzToolsFramework::InstanceDataHierarchy::ValueComparisonFunction& valueComparisonFunction,
const AzToolsFramework::IndicatorQueryFunction& indicatorQueryFunction) const AzToolsFramework::IndicatorQueryFunction& indicatorQueryFunction,
int leafIndentSize)
: InspectorGroupWidget(parent) : InspectorGroupWidget(parent)
{ {
AZ::SerializeContext* context = nullptr; AZ::SerializeContext* context = nullptr;
@ -33,7 +34,8 @@ namespace AtomToolsFramework
m_propertyEditor = new AzToolsFramework::ReflectedPropertyEditor(this); m_propertyEditor = new AzToolsFramework::ReflectedPropertyEditor(this);
m_propertyEditor->SetHideRootProperties(true); m_propertyEditor->SetHideRootProperties(true);
m_propertyEditor->SetAutoResizeLabels(true); m_propertyEditor->SetAutoResizeLabels(false);
m_propertyEditor->SetLeafIndentation(leafIndentSize);
m_propertyEditor->SetValueComparisonFunction(valueComparisonFunction); m_propertyEditor->SetValueComparisonFunction(valueComparisonFunction);
m_propertyEditor->SetIndicatorQueryFunction(indicatorQueryFunction); m_propertyEditor->SetIndicatorQueryFunction(indicatorQueryFunction);
m_propertyEditor->SetSavedStateKey(saveStateKey); m_propertyEditor->SetSavedStateKey(saveStateKey);

@ -150,6 +150,7 @@ namespace AtomToolsFramework
ComparePropertyValues<AZ::Vector4>(valueA, valueB) || ComparePropertyValues<AZ::Vector4>(valueA, valueB) ||
ComparePropertyValues<AZ::Color>(valueA, valueB) || ComparePropertyValues<AZ::Color>(valueA, valueB) ||
ComparePropertyValues<AZ::Data::AssetId>(valueA, valueB) || ComparePropertyValues<AZ::Data::AssetId>(valueA, valueB) ||
ComparePropertyValues<AZ::Data::Asset<AZ::Data::AssetData>>(valueA, valueB) ||
ComparePropertyValues<AZ::Data::Asset<AZ::RPI::ImageAsset>>(valueA, valueB) || ComparePropertyValues<AZ::Data::Asset<AZ::RPI::ImageAsset>>(valueA, valueB) ||
ComparePropertyValues<AZ::Data::Asset<AZ::RPI::StreamingImageAsset>>(valueA, valueB) || ComparePropertyValues<AZ::Data::Asset<AZ::RPI::StreamingImageAsset>>(valueA, valueB) ||
ComparePropertyValues<AZ::Data::Asset<AZ::RPI::MaterialAsset>>(valueA, valueB) || ComparePropertyValues<AZ::Data::Asset<AZ::RPI::MaterialAsset>>(valueA, valueB) ||

@ -103,7 +103,7 @@ namespace MaterialEditor
{ {
return ":/PropertyEditor/Resources/changed_data_item.png"; return ":/PropertyEditor/Resources/changed_data_item.png";
} }
return nullptr; return ":/PropertyEditor/Resources/blank.png";
} }
void MaterialInspector::AddOverviewGroup() void MaterialInspector::AddOverviewGroup()
@ -130,7 +130,7 @@ namespace MaterialEditor
// Passing in same group as main and comparison instance to enable custom value comparison for highlighting modified properties // Passing in same group as main and comparison instance to enable custom value comparison for highlighting modified properties
auto propertyGroupWidget = new AtomToolsFramework::InspectorPropertyGroupWidget( auto propertyGroupWidget = new AtomToolsFramework::InspectorPropertyGroupWidget(
&group, &group, group.TYPEINFO_Uuid(), this, this, GetGroupSaveStateKey(groupNameId), {}, &group, &group, group.TYPEINFO_Uuid(), this, this, GetGroupSaveStateKey(groupNameId), {},
[this](const auto node) { return GetInstanceNodePropertyIndicator(node); }); [this](const auto node) { return GetInstanceNodePropertyIndicator(node); }, 0);
AddGroup(groupNameId, groupDisplayName, groupDescription, propertyGroupWidget); AddGroup(groupNameId, groupDisplayName, groupDescription, propertyGroupWidget);
} }
@ -161,7 +161,7 @@ namespace MaterialEditor
// Passing in same group as main and comparison instance to enable custom value comparison for highlighting modified properties // Passing in same group as main and comparison instance to enable custom value comparison for highlighting modified properties
auto propertyGroupWidget = new AtomToolsFramework::InspectorPropertyGroupWidget( auto propertyGroupWidget = new AtomToolsFramework::InspectorPropertyGroupWidget(
&group, &group, group.TYPEINFO_Uuid(), this, this, GetGroupSaveStateKey(groupNameId), {}, &group, &group, group.TYPEINFO_Uuid(), this, this, GetGroupSaveStateKey(groupNameId), {},
[this](const auto node) { return GetInstanceNodePropertyIndicator(node); }); [this](const auto node) { return GetInstanceNodePropertyIndicator(node); }, 0);
AddGroup(groupNameId, groupDisplayName, groupDescription, propertyGroupWidget); AddGroup(groupNameId, groupDisplayName, groupDescription, propertyGroupWidget);
} }
@ -197,7 +197,7 @@ namespace MaterialEditor
// Passing in same group as main and comparison instance to enable custom value comparison for highlighting modified properties // Passing in same group as main and comparison instance to enable custom value comparison for highlighting modified properties
auto propertyGroupWidget = new AtomToolsFramework::InspectorPropertyGroupWidget( auto propertyGroupWidget = new AtomToolsFramework::InspectorPropertyGroupWidget(
&group, &group, group.TYPEINFO_Uuid(), this, this, GetGroupSaveStateKey(groupNameId), {}, &group, &group, group.TYPEINFO_Uuid(), this, this, GetGroupSaveStateKey(groupNameId), {},
[this](const auto node) { return GetInstanceNodePropertyIndicator(node); }); [this](const auto node) { return GetInstanceNodePropertyIndicator(node); }, 0);
AddGroup(groupNameId, groupDisplayName, groupDescription, propertyGroupWidget); AddGroup(groupNameId, groupDisplayName, groupDescription, propertyGroupWidget);
bool isGroupVisible = false; bool isGroupVisible = false;

Loading…
Cancel
Save