diff --git a/Code/Editor/ViewportTitleDlg.ui b/Code/Editor/ViewportTitleDlg.ui index e67f04b68a..9b02876054 100644 --- a/Code/Editor/ViewportTitleDlg.ui +++ b/Code/Editor/ViewportTitleDlg.ui @@ -28,7 +28,7 @@ 29 - + 10 @@ -42,19 +42,18 @@ 0 - - - - :/Breadcrumb/img/UI20/Breadcrumb/arrow_left-default.svg:/Breadcrumb/img/UI20/Breadcrumb/arrow_left-default.svg - - - - Back - - - + + + Up one level + + + + :/Breadcrumb/img/UI20/Breadcrumb/arrow_left-default.svg:/Breadcrumb/img/UI20/Breadcrumb/arrow_left-default.svg + + + - + 0 @@ -64,70 +63,78 @@ - - - - :/Menu/camera.svg:/Menu/camera.svg - - - - Camera settings - - - + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Camera settings + + + + :/Menu/camera.svg:/Menu/camera.svg + + + - - - Debug information - - - - :/Menu/debug.svg:/Menu/debug.svg - - - - true - - - + + + Debug information + + + + :/Menu/debug.svg:/Menu/debug.svg + + + true + + + - - - Toggle viewport helpers - - - - :/Menu/helpers.svg:/Menu/helpers.svg - - - - true - - - + + + Toggle viewport helpers + + + + :/Menu/helpers.svg:/Menu/helpers.svg + + + true + + + - - - Viewport resolution - - - - :/Menu/resolution.svg:/Menu/resolution.svg - - - + + + Viewport resolution + + + + :/Menu/resolution.svg:/Menu/resolution.svg + + - - - Other settings - - - - :/Menu/menu.svg:/Menu/menu.svg - - - + + + Other settings + + + + :/Menu/menu.svg:/Menu/menu.svg + + @@ -138,15 +145,9 @@
AzQtComponents/Components/Widgets/Breadcrumbs.h
1 - - AzQtComponents::ButtonDivider - QWidget -
AzQtComponents/Components/ButtonDivider.h
- 1 -
- - - - + + + + diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabFocusHandler.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabFocusHandler.cpp index e2f5660bb7..9ee05425ef 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabFocusHandler.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabFocusHandler.cpp @@ -8,6 +8,7 @@ #include +#include #include #include #include @@ -83,11 +84,17 @@ namespace AzToolsFramework::Prefab m_focusedInstance = focusedInstance; m_focusedTemplateId = focusedInstance->get().GetTemplateId(); - FocusModeInterface* focusModeInterface = AZ::Interface::Get(); - if (focusModeInterface) - { - focusModeInterface->SetFocusRoot(focusedInstance->get().GetContainerEntityId()); - } + AZ::EntityId containerEntityId = focusedInstance->get().GetContainerEntityId(); + + // Select the container entity + AzToolsFramework::SelectEntity(containerEntityId); + + // Focus on the descendants of the container entity + FocusModeInterface* focusModeInterface = AZ::Interface::Get(); + if (focusModeInterface) + { + focusModeInterface->SetFocusRoot(containerEntityId); + } RefreshInstanceFocusList(); diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Prefab/PrefabViewportFocusPathHandler.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Prefab/PrefabViewportFocusPathHandler.cpp index 2c5bc361ea..c83c0016be 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Prefab/PrefabViewportFocusPathHandler.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Prefab/PrefabViewportFocusPathHandler.cpp @@ -11,6 +11,12 @@ namespace AzToolsFramework::Prefab { + PrefabViewportFocusPathHandler::PrefabViewportFocusPathHandler() + { + // Connect to Prefab Focus Notifications + PrefabFocusNotificationBus::Handler::BusConnect(); + } + PrefabViewportFocusPathHandler::~PrefabViewportFocusPathHandler() { // Disconnect from Prefab Focus Notifications @@ -27,9 +33,6 @@ namespace AzToolsFramework::Prefab return; } - // Connect to Prefab Focus Notifications - PrefabFocusNotificationBus::Handler::BusConnect(); - // Initialize Widgets m_breadcrumbsWidget = breadcrumbsWidget; m_backButton = backButton; @@ -60,16 +63,6 @@ namespace AzToolsFramework::Prefab { // Push new Path m_breadcrumbsWidget->pushPath(m_prefabFocusInterface->GetPrefabFocusPath().c_str()); - - // Only show the back icon button if the path has more than one element - if(m_prefabFocusInterface->GetPrefabFocusPathLength() > 1) - { - m_backButton->show(); - } - else - { - m_backButton->hide(); - } } } // namespace AzToolsFramework::Prefab diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Prefab/PrefabViewportFocusPathHandler.h b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Prefab/PrefabViewportFocusPathHandler.h index 63e5579c00..c874c7249f 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Prefab/PrefabViewportFocusPathHandler.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Prefab/PrefabViewportFocusPathHandler.h @@ -24,6 +24,7 @@ namespace AzToolsFramework::Prefab , private QObject { public: + PrefabViewportFocusPathHandler(); ~PrefabViewportFocusPathHandler(); void Initialize(AzQtComponents::BreadCrumbs* breadcrumbsWidget, QToolButton* backButton);