Add icon support for the Breadcrumbs UI Component, use it in the Prefab Focus Mode breadcrumbs. (#7136)

* Add icon support for the Breadcrumbs UI Component, use it in the prefab focus mode breadcrumb.

Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>

* Simplified iconAt logic

Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
This commit is contained in:
Danilo Aimini
2022-01-25 12:00:30 -08:00
committed by GitHub
parent aab3d8df67
commit 50015f8599
3 changed files with 80 additions and 7 deletions
@@ -44,6 +44,9 @@ namespace AzToolsFramework::Prefab
m_breadcrumbsWidget = breadcrumbsWidget;
m_backButton = backButton;
// Add icons to the widget
m_breadcrumbsWidget->setDefaultIcon(QString(":/Entity/prefab_edit.svg"));
// If a part of the path is clicked, focus on that instance
connect(m_breadcrumbsWidget, &AzQtComponents::BreadCrumbs::linkClicked, this,
[&](const QString&, int linkIndex)
@@ -74,6 +77,9 @@ namespace AzToolsFramework::Prefab
// Push new Path
m_breadcrumbsWidget->pushPath(m_prefabFocusPublicInterface->GetPrefabFocusPath(m_editorEntityContextId).c_str());
// Set root icon
m_breadcrumbsWidget->setIconAt(0, QString(":/Level/level.svg"));
// If root instance is focused, disable the back button; else enable it.
m_backButton->setEnabled(m_prefabFocusPublicInterface->GetPrefabFocusPathLength(m_editorEntityContextId) > 1);
}