Minor fixes to pass AR

Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
monroegm-disable-blank-issue-2
Danilo Aimini 4 years ago
parent 55e2684471
commit be88be4bb8

@ -28,7 +28,7 @@
<height>29</height>
</size>
</property>
<layout class="QHBoxLayout" name="horizontalLayout" stretch="1,0,0,0,0,0,0,0,0">
<layout class="QHBoxLayout" name="horizontalLayout" stretch="1,0,0,0,0,0,0,0">
<property name="leftMargin">
<number>10</number>
</property>
@ -42,19 +42,18 @@
<number>0</number>
</property>
<item>
<widget class="QToolButton" name="m_prefabFocusBackButton">
<property name="icon">
<iconset>
<normaloff>:/Breadcrumb/img/UI20/Breadcrumb/arrow_left-default.svg</normaloff>:/Breadcrumb/img/UI20/Breadcrumb/arrow_left-default.svg
</iconset>
</property>
<property name="toolTip">
<string>Back</string>
</property>
</widget>
</item>
<widget class="QToolButton" name="m_prefabFocusBackButton">
<property name="toolTip">
<string>Up one level</string>
</property>
<property name="icon">
<iconset>
<normaloff>:/Breadcrumb/img/UI20/Breadcrumb/arrow_left-default.svg</normaloff>:/Breadcrumb/img/UI20/Breadcrumb/arrow_left-default.svg</iconset>
</property>
</widget>
</item>
<item>
<widget class="AzQtComponents::BreadCrumbs" name="m_prefabFocusPath">
<widget class="AzQtComponents::BreadCrumbs" name="m_prefabFocusPath" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
@ -64,70 +63,78 @@
</widget>
</item>
<item>
<widget class="QToolButton" name="m_cameraMenu">
<property name="icon">
<iconset>
<normaloff>:/Menu/camera.svg</normaloff>:/Menu/camera.svg
</iconset>
</property>
<property name="toolTip">
<string>Camera settings</string>
</property>
</widget>
</item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QToolButton" name="m_cameraMenu">
<property name="toolTip">
<string>Camera settings</string>
</property>
<property name="icon">
<iconset>
<normaloff>:/Menu/camera.svg</normaloff>:/Menu/camera.svg</iconset>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="m_debugInformationMenu">
<property name="toolTip">
<string>Debug information</string>
</property>
<property name="icon">
<iconset>
<normaloff>:/Menu/debug.svg</normaloff>:/Menu/debug.svg
</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<widget class="QToolButton" name="m_debugInformationMenu">
<property name="toolTip">
<string>Debug information</string>
</property>
<property name="icon">
<iconset>
<normaloff>:/Menu/debug.svg</normaloff>:/Menu/debug.svg</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="m_helpers">
<property name="toolTip">
<string>Toggle viewport helpers</string>
</property>
<property name="icon">
<iconset>
<normaloff>:/Menu/helpers.svg</normaloff>:/Menu/helpers.svg
</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<widget class="QToolButton" name="m_helpers">
<property name="toolTip">
<string>Toggle viewport helpers</string>
</property>
<property name="icon">
<iconset>
<normaloff>:/Menu/helpers.svg</normaloff>:/Menu/helpers.svg</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="m_resolutionMenu">
<property name="toolTip">
<string>Viewport resolution</string>
</property>
<property name="icon">
<iconset>
<normaloff>:/Menu/resolution.svg</normaloff>:/Menu/resolution.svg
</iconset>
</property>
</widget>
<widget class="QToolButton" name="m_resolutionMenu">
<property name="toolTip">
<string>Viewport resolution</string>
</property>
<property name="icon">
<iconset>
<normaloff>:/Menu/resolution.svg</normaloff>:/Menu/resolution.svg</iconset>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="m_overflowBtn">
<property name="toolTip">
<string>Other settings</string>
</property>
<property name="icon">
<iconset>
<normaloff>:/Menu/menu.svg</normaloff>:/Menu/menu.svg
</iconset>
</property>
</widget>
<widget class="QToolButton" name="m_overflowBtn">
<property name="toolTip">
<string>Other settings</string>
</property>
<property name="icon">
<iconset>
<normaloff>:/Menu/menu.svg</normaloff>:/Menu/menu.svg</iconset>
</property>
</widget>
</item>
</layout>
</widget>
@ -138,15 +145,9 @@
<header>AzQtComponents/Components/Widgets/Breadcrumbs.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>AzQtComponents::ButtonDivider</class>
<extends>QWidget</extends>
<header>AzQtComponents/Components/ButtonDivider.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources>
<include location="../../Framework/AzQtComponents/AzQtComponents/Images/resources.qrc"/>
</resources>
<connections/>
<resources>
<include location="../../Framework/AzQtComponents/AzQtComponents/Images/resources.qrc"/>
</resources>
<connections/>
</ui>

@ -8,6 +8,7 @@
#include <AzToolsFramework/Prefab/PrefabFocusHandler.h>
#include <AzToolsFramework/Entity/EditorEntityHelpers.h>
#include <AzToolsFramework/Entity/PrefabEditorEntityOwnershipInterface.h>
#include <AzToolsFramework/Prefab/Instance/Instance.h>
#include <AzToolsFramework/Prefab/Instance/InstanceEntityMapperInterface.h>
@ -83,11 +84,17 @@ namespace AzToolsFramework::Prefab
m_focusedInstance = focusedInstance;
m_focusedTemplateId = focusedInstance->get().GetTemplateId();
FocusModeInterface* focusModeInterface = AZ::Interface<FocusModeInterface>::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<FocusModeInterface>::Get();
if (focusModeInterface)
{
focusModeInterface->SetFocusRoot(containerEntityId);
}
RefreshInstanceFocusList();

@ -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

@ -24,6 +24,7 @@ namespace AzToolsFramework::Prefab
, private QObject
{
public:
PrefabViewportFocusPathHandler();
~PrefabViewportFocusPathHandler();
void Initialize(AzQtComponents::BreadCrumbs* breadcrumbsWidget, QToolButton* backButton);

Loading…
Cancel
Save