Refresh delegate painting in the Outliner even if the widget is not in focus.

Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
This commit is contained in:
Danilo Aimini
2021-09-21 17:09:31 -07:00
parent e2c4dbe277
commit 7a0be4ff65
6 changed files with 58 additions and 5 deletions
@@ -0,0 +1,27 @@
/*
* Copyright (c) Contributors to the Open 3D Engine Project.
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
#pragma once
#include <AzCore/Component/EntityId.h>
#include <AzCore/EBus/EBus.h>
namespace AzToolsFramework
{
class FocusModeNotifications
: public AZ::EBusTraits
{
public:
virtual ~FocusModeNotifications() = default;
virtual void OnEditorFocusChanged(AZ::EntityId entityId) = 0;
};
using FocusModeNotificationBus = AZ::EBus<FocusModeNotifications>;
} // namespace AzToolsFramework
@@ -9,6 +9,7 @@
#include <AzCore/Component/TransformBus.h>
#include <AzToolsFramework/API/ViewportEditorModeTrackerInterface.h>
#include <AzToolsFramework/FocusMode/FocusModeNotificationBus.h>
#include <AzToolsFramework/FocusMode/FocusModeSystemComponent.h>
namespace AzToolsFramework
@@ -64,7 +65,13 @@ namespace AzToolsFramework
void FocusModeSystemComponent::SetFocusRoot(AZ::EntityId entityId)
{
if (m_focusRoot == entityId)
{
return;
}
m_focusRoot = entityId;
FocusModeNotificationBus::Broadcast(&FocusModeNotifications::OnEditorFocusChanged, m_focusRoot);
// TODO - If m_focusRoot != AZ::EntityId(), activate focus mode via ViewportEditorModeTrackerInterface; else, deactivate focus mode
}