Fixed issues after merging latest main, as well as some edge cases I didn't notice before.
The structure of InspectorWidget::m_groups changed, so I had to update my new code accordingly. Updated the InspectorWidget::m_groups code a bit to be more readable. Discovered the initial property group visiblity state wasn't being set correctly when a material was first opened, so groups weren't initially hidden when they should have been. This had to be fixed in different ways for MaterialEditor's inspector and MaterialComponent's inspector. ATOM-14688 Disable Individual Layers
This commit is contained in:
+6
-1
@@ -47,8 +47,13 @@ namespace AtomToolsFramework
|
||||
//! Sets the visibility of a specific property group. This impacts both the header and the widget.
|
||||
virtual void SetGroupVisible(const AZStd::string& groupNameId, bool visible) = 0;
|
||||
|
||||
//! Returns the visibility of a specific property group.
|
||||
//! Returns whether a specific property is visible.
|
||||
//! Note this follows the same rules as QWidget::isVisible(), meaning a group could be not visible due to the widget's parents being not visible.
|
||||
virtual bool IsGroupVisible(const AZStd::string& groupNameId) const = 0;
|
||||
|
||||
//! Returns whether a specific property is explicitly hidden.
|
||||
//! Note this follows the same rules as QWidget::isHidden(), meaning a group that is hidden will not become visible automatically when the parent becomes visible.
|
||||
virtual bool IsGroupHidden(const AZStd::string& groupNameId) const = 0;
|
||||
|
||||
//! Calls Refresh for a specific InspectorGroupWidget, allowing for non-destructive UI changes
|
||||
virtual void RefreshGroup(const AZStd::string& groupNameId) = 0;
|
||||
|
||||
+9
-1
@@ -59,6 +59,7 @@ namespace AtomToolsFramework
|
||||
|
||||
void SetGroupVisible(const AZStd::string& groupNameId, bool visible) override;
|
||||
bool IsGroupVisible(const AZStd::string& groupNameId) const override;
|
||||
bool IsGroupHidden(const AZStd::string& groupNameId) const override;
|
||||
|
||||
void RefreshGroup(const AZStd::string& groupNameId) override;
|
||||
void RebuildGroup(const AZStd::string& groupNameId) override;
|
||||
@@ -82,6 +83,13 @@ namespace AtomToolsFramework
|
||||
private:
|
||||
QVBoxLayout* m_layout = nullptr;
|
||||
QScopedPointer<Ui::InspectorWidget> m_ui;
|
||||
AZStd::unordered_map<AZStd::string, AZStd::pair<InspectorGroupHeaderWidget*, QWidget*>> m_groups;
|
||||
|
||||
struct GroupWidgetPair
|
||||
{
|
||||
InspectorGroupHeaderWidget* m_header;
|
||||
QWidget* m_panel;
|
||||
};
|
||||
|
||||
AZStd::unordered_map<AZStd::string, GroupWidgetPair> m_groups;
|
||||
};
|
||||
} // namespace AtomToolsFramework
|
||||
|
||||
Reference in New Issue
Block a user