Merge pull request #660 from aws-lumberyard-dev/Atom/guthadam/ATOM-15486
ATOM-15486 Material Editor: Implement layout and user settings
This commit is contained in:
+3
-1
@@ -29,11 +29,13 @@ namespace AtomToolsFramework
|
||||
AZ_CLASS_ALLOCATOR(InspectorGroupHeaderWidget, AZ::SystemAllocator, 0);
|
||||
|
||||
explicit InspectorGroupHeaderWidget(QWidget* parent = nullptr);
|
||||
void SetExpanded(bool expanded);
|
||||
void SetExpanded(bool expand);
|
||||
bool IsExpanded() const;
|
||||
|
||||
Q_SIGNALS:
|
||||
void clicked(QMouseEvent* event);
|
||||
void expanded();
|
||||
void collapsed();
|
||||
|
||||
protected:
|
||||
void mousePressEvent(QMouseEvent* event) override;
|
||||
|
||||
+1
@@ -44,6 +44,7 @@ namespace AtomToolsFramework
|
||||
const AZ::Uuid& instanceClassId,
|
||||
AzToolsFramework::IPropertyEditorNotify* instanceNotificationHandler = {},
|
||||
QWidget* parent = {},
|
||||
const AZ::u32 saveStateKey = {},
|
||||
const AzToolsFramework::InstanceDataHierarchy::ValueComparisonFunction& valueComparisonFunction = {});
|
||||
|
||||
void Refresh() override;
|
||||
|
||||
+9
@@ -56,6 +56,15 @@ namespace AtomToolsFramework
|
||||
//! Calls Rebuild for all InspectorGroupWidget, allowing for destructive UI changes
|
||||
virtual void RebuildAll() = 0;
|
||||
|
||||
//! Expands a specific group
|
||||
virtual void ExpandGroup(const AZStd::string& groupNameId) = 0;
|
||||
|
||||
//! Collapses a specific group
|
||||
virtual void CollapseGroup(const AZStd::string& groupNameId) = 0;
|
||||
|
||||
//! Checks the expansion state of a specific group
|
||||
virtual bool IsGroupExpanded(const AZStd::string& groupNameId) const = 0;
|
||||
|
||||
//! Expands all groups and headers
|
||||
virtual void ExpandAll() = 0;
|
||||
|
||||
|
||||
+11
-4
@@ -63,15 +63,22 @@ namespace AtomToolsFramework
|
||||
void RefreshAll() override;
|
||||
void RebuildAll() override;
|
||||
|
||||
void ExpandGroup(const AZStd::string& groupNameId) override;
|
||||
void CollapseGroup(const AZStd::string& groupNameId) override;
|
||||
bool IsGroupExpanded(const AZStd::string& groupNameId) const override;
|
||||
|
||||
void ExpandAll() override;
|
||||
void CollapseAll() override;
|
||||
|
||||
private:
|
||||
void OnHeaderClicked(QMouseEvent* event, InspectorGroupHeaderWidget* groupHeader, QWidget* groupWidget);
|
||||
protected:
|
||||
virtual bool ShouldGroupAutoExpanded(const AZStd::string& groupNameId) const;
|
||||
virtual void OnGroupExpanded(const AZStd::string& groupNameId);
|
||||
virtual void OnGroupCollapsed(const AZStd::string& groupNameId);
|
||||
virtual void OnHeaderClicked(const AZStd::string& groupNameId, QMouseEvent* event);
|
||||
|
||||
private:
|
||||
QVBoxLayout* m_layout = nullptr;
|
||||
QScopedPointer<Ui::InspectorWidget> m_ui;
|
||||
AZStd::vector<InspectorGroupHeaderWidget*> m_headers;
|
||||
AZStd::vector<QWidget*> m_groups;
|
||||
AZStd::unordered_map<AZStd::string, AZStd::pair<InspectorGroupHeaderWidget*, QWidget*>> m_groups;
|
||||
};
|
||||
} // namespace AtomToolsFramework
|
||||
|
||||
Reference in New Issue
Block a user