Implemented the PrefabViewportFocusPathHandler class, added a breadcrumb widget to the viewport toolbar to display the currently focused prefab path.
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
This commit is contained in:
@@ -292,8 +292,6 @@ void CViewportTitleDlg::SetViewPane(CLayoutViewPane* pViewPane)
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CViewportTitleDlg::OnInitDialog()
|
||||
{
|
||||
m_ui->m_titleBtn->setText(m_title);
|
||||
|
||||
// Add a child parented to us that listens for r_displayInfo changes.
|
||||
auto displayInfoHelper = new CViewportTitleDlgDisplayInfoHelper(this);
|
||||
connect(displayInfoHelper, &CViewportTitleDlgDisplayInfoHelper::ViewportInfoStatusUpdated, this, &CViewportTitleDlg::UpdateDisplayInfo);
|
||||
@@ -314,13 +312,13 @@ void CViewportTitleDlg::OnInitDialog()
|
||||
|
||||
m_cameraSpeed->setFixedWidth(width);
|
||||
|
||||
m_prefabViewportFocusPathHandler.Initialize(m_ui->m_prefabFocusPath, m_ui->m_prefabFocusBackButton);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CViewportTitleDlg::SetTitle(const QString& title)
|
||||
{
|
||||
m_title = title;
|
||||
m_ui->m_titleBtn->setText(m_title);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include <QWidgetAction>
|
||||
#include <QComboBox>
|
||||
|
||||
#include <AzToolsFramework/UI/Prefab/PrefabViewportFocusPathHandler.h>
|
||||
#include <AzQtComponents/Components/Widgets/SpinBox.h>
|
||||
|
||||
#include <HMDBus.h>
|
||||
@@ -176,6 +177,8 @@ protected:
|
||||
QWidgetAction* m_gridSizeActionWidget = nullptr;
|
||||
QWidgetAction* m_angleSizeActionWidget = nullptr;
|
||||
|
||||
AzToolsFramework::Prefab::PrefabViewportFocusPathHandler m_prefabViewportFocusPathHandler;
|
||||
|
||||
QScopedPointer<Ui::ViewportTitleDlg> m_ui;
|
||||
};
|
||||
|
||||
|
||||
@@ -42,22 +42,25 @@
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="m_titleBtn">
|
||||
<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>
|
||||
<item>
|
||||
<widget class="AzQtComponents::BreadCrumbs" name="m_prefabFocusPath">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="contextMenuPolicy">
|
||||
<enum>Qt::NoContextMenu</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Static</string>
|
||||
</property>
|
||||
<property name="indent">
|
||||
<number>11</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
@@ -129,6 +132,12 @@
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>AzQtComponents::BreadCrumbs</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>AzQtComponents/Components/Widgets/Breadcrumbs.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>AzQtComponents::ButtonDivider</class>
|
||||
<extends>QWidget</extends>
|
||||
|
||||
Reference in New Issue
Block a user