Make sure to autoscroll to a selected entity after a rename (#872)
This commit is contained in:
+11
@@ -63,6 +63,7 @@
|
||||
#include <AzToolsFramework/UI/Outliner/EntityOutlinerDisplayOptionsMenu.h>
|
||||
#include <AzToolsFramework/UI/Outliner/EntityOutlinerSortFilterProxyModel.hxx>
|
||||
#include <AzToolsFramework/UI/Outliner/EntityOutlinerTreeView.hxx>
|
||||
#include <AzToolsFramework/UI/Outliner/EntityOutlinerCacheBus.h>
|
||||
#include <AzToolsFramework/UI/UICore/WidgetHelpers.h>
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
@@ -1409,6 +1410,16 @@ namespace AzToolsFramework
|
||||
{
|
||||
(void)name;
|
||||
QueueEntityUpdate(entityId);
|
||||
|
||||
bool isSelected = false;
|
||||
AzToolsFramework::ToolsApplicationRequests::Bus::BroadcastResult(
|
||||
isSelected, &AzToolsFramework::ToolsApplicationRequests::IsSelected, entityId);
|
||||
|
||||
if (isSelected)
|
||||
{
|
||||
// Ask the system to scroll to the entity in case it is off screen after the rename
|
||||
EntityOutlinerModelNotificationBus::Broadcast(&EntityOutlinerModelNotifications::QueueScrollToNewContent, entityId);
|
||||
}
|
||||
}
|
||||
|
||||
void EntityOutlinerListModel::OnEntityInfoUpdatedUnsavedChanges(AZ::EntityId entityId)
|
||||
|
||||
@@ -65,6 +65,7 @@
|
||||
#include "OutlinerTreeView.hxx"
|
||||
#include "Include/ICommandManager.h"
|
||||
#include "Include/IObjectManager.h"
|
||||
#include "OutlinerCacheBus.h"
|
||||
|
||||
#include <Editor/CryEditDoc.h>
|
||||
#include <AzCore/Outcome/Outcome.h>
|
||||
@@ -1538,6 +1539,16 @@ void OutlinerListModel::OnEntityInfoUpdatedName(AZ::EntityId entityId, const AZS
|
||||
{
|
||||
(void)name;
|
||||
QueueEntityUpdate(entityId);
|
||||
|
||||
bool isSelected = false;
|
||||
AzToolsFramework::ToolsApplicationRequests::Bus::BroadcastResult(
|
||||
isSelected, &AzToolsFramework::ToolsApplicationRequests::IsSelected, entityId);
|
||||
|
||||
if (isSelected)
|
||||
{
|
||||
// Ask the system to scroll to the entity in case it is off screen after the rename
|
||||
OutlinerModelNotificationBus::Broadcast(&OutlinerModelNotifications::QueueScrollToNewContent, entityId);
|
||||
}
|
||||
}
|
||||
|
||||
void OutlinerListModel::OnEntityInfoUpdatedUnsavedChanges(AZ::EntityId entityId)
|
||||
|
||||
Reference in New Issue
Block a user