merge main
This commit is contained in:
+1
-1
@@ -35,4 +35,4 @@ namespace AzToolsFramework
|
||||
}
|
||||
}
|
||||
|
||||
#include "UI/ComponentPalette/moc_ComponentPaletteModel.cpp"
|
||||
#include "UI/ComponentPalette/moc_ComponentPaletteModel.cpp"
|
||||
|
||||
+1
-1
@@ -55,4 +55,4 @@ namespace AzToolsFramework
|
||||
}
|
||||
}
|
||||
|
||||
#include "UI/ComponentPalette/moc_ComponentPaletteModelFilter.cpp"
|
||||
#include "UI/ComponentPalette/moc_ComponentPaletteModelFilter.cpp"
|
||||
|
||||
+5
@@ -61,6 +61,11 @@ namespace AzToolsFramework
|
||||
return true;
|
||||
}
|
||||
|
||||
bool EditorEntityUiHandlerBase::CanRename(AZ::EntityId /*entityId*/) const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void EditorEntityUiHandlerBase::PaintItemBackground(QPainter* /*painter*/, const QStyleOptionViewItem& /*option*/, const QModelIndex& /*index*/) const
|
||||
{
|
||||
}
|
||||
|
||||
+2
@@ -47,6 +47,8 @@ namespace AzToolsFramework
|
||||
virtual QPixmap GenerateItemIcon(AZ::EntityId entityId) const;
|
||||
//! Returns whether the element's lock and visibility state should be accessible in the Outliner
|
||||
virtual bool CanToggleLockVisibility(AZ::EntityId entityId) const;
|
||||
//! Returns whether the element's name should be editable
|
||||
virtual bool CanRename(AZ::EntityId entityId) const;
|
||||
|
||||
//! Paints the background of the item in the Outliner.
|
||||
virtual void PaintItemBackground(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const;
|
||||
|
||||
@@ -24,4 +24,4 @@ namespace AzToolsFramework
|
||||
QMenu* parentMenu,
|
||||
const AzToolsFramework::EntityIdSet& entitySelectionWithFlatHierarchy,
|
||||
NewLayerFunction newLayerFunction);
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -51,4 +51,4 @@ namespace LegacyFramework
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
+4
@@ -192,6 +192,10 @@ namespace LegacyFramework
|
||||
// if we're in console mode, listen for CTRL+C
|
||||
::SetConsoleCtrlHandler(CTRL_BREAK_HandlerRoutine, true);
|
||||
#endif
|
||||
|
||||
m_ptrCommandLineParser = aznew AzFramework::CommandLine();
|
||||
m_ptrCommandLineParser->Parse(m_desc.m_argc, m_desc.m_argv);
|
||||
|
||||
// If we don't have one create a serialize context
|
||||
if (GetSerializeContext() == nullptr)
|
||||
{
|
||||
|
||||
+1
-1
@@ -62,4 +62,4 @@ namespace AzToolsFramework
|
||||
->Field("m_serializableWindowState", &MainWindowSavedState::m_serializableWindowState);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -53,4 +53,4 @@ namespace AzToolsFramework
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
+1
-1
@@ -94,4 +94,4 @@ namespace AzToolsFramework
|
||||
|
||||
return dlg.m_result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,4 +92,4 @@ namespace AzToolsFramework
|
||||
} // Logging
|
||||
} // AzToolsFramework
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -104,4 +104,4 @@ namespace AzToolsFramework
|
||||
}
|
||||
}
|
||||
|
||||
Q_DECLARE_METATYPE(const AzToolsFramework::Logging::LogLine*);
|
||||
Q_DECLARE_METATYPE(const AzToolsFramework::Logging::LogLine*);
|
||||
|
||||
+1
-1
@@ -115,4 +115,4 @@ namespace AzToolsFramework
|
||||
} // namespace Logging
|
||||
} // namespace AzToolsFramework
|
||||
|
||||
#include "UI/Logging/moc_LogTableItemDelegate.cpp"
|
||||
#include "UI/Logging/moc_LogTableItemDelegate.cpp"
|
||||
|
||||
@@ -316,4 +316,4 @@ namespace AzToolsFramework
|
||||
}
|
||||
} // namespace AzToolsFramework
|
||||
|
||||
#include "UI/Logging/moc_LogTableModel.cpp"
|
||||
#include "UI/Logging/moc_LogTableModel.cpp"
|
||||
|
||||
@@ -29,4 +29,4 @@ namespace AzToolsFramework
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -56,4 +56,4 @@ namespace AzToolsFramework
|
||||
} // namespace LogPanel
|
||||
} // namespace AzToolsFramework
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -102,4 +102,4 @@ namespace AzToolsFramework
|
||||
virtual void Clear();
|
||||
};
|
||||
} // namespace LogPanel
|
||||
} // namespace AzToolsFramework
|
||||
} // namespace AzToolsFramework
|
||||
|
||||
+25
-24
@@ -945,6 +945,12 @@ namespace AzToolsFramework
|
||||
return false;
|
||||
}
|
||||
|
||||
// Disable reparenting to the root level
|
||||
if (!newParentId.IsValid())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Ignore entities not owned by the editor context. It is assumed that all entities belong
|
||||
// to the same context since multiple selection doesn't span across views.
|
||||
for (const AZ::EntityId& entityId : selectedEntityIds)
|
||||
@@ -974,39 +980,33 @@ namespace AzToolsFramework
|
||||
}
|
||||
}
|
||||
|
||||
if (newParentId.IsValid())
|
||||
bool isLayerEntity = false;
|
||||
Layers::EditorLayerComponentRequestBus::EventResult(
|
||||
isLayerEntity,
|
||||
entityId,
|
||||
&Layers::EditorLayerComponentRequestBus::Events::HasLayer);
|
||||
// Layers can only have other layers as parents, or have no parent.
|
||||
if (isLayerEntity)
|
||||
{
|
||||
bool isLayerEntity = false;
|
||||
bool newParentIsLayer = false;
|
||||
Layers::EditorLayerComponentRequestBus::EventResult(
|
||||
isLayerEntity,
|
||||
entityId,
|
||||
newParentIsLayer,
|
||||
newParentId,
|
||||
&Layers::EditorLayerComponentRequestBus::Events::HasLayer);
|
||||
// Layers can only have other layers as parents, or have no parent.
|
||||
if (isLayerEntity)
|
||||
if (!newParentIsLayer)
|
||||
{
|
||||
bool newParentIsLayer = false;
|
||||
Layers::EditorLayerComponentRequestBus::EventResult(
|
||||
newParentIsLayer,
|
||||
newParentId,
|
||||
&Layers::EditorLayerComponentRequestBus::Events::HasLayer);
|
||||
if (!newParentIsLayer)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Only check the entity pointer if the entity id is valid because
|
||||
//we want to allow dragging items to unoccupied parts of the tree to un-parent them
|
||||
if (newParentId.IsValid())
|
||||
AZ::Entity* newParentEntity = nullptr;
|
||||
AZ::ComponentApplicationBus::BroadcastResult(newParentEntity, &AZ::ComponentApplicationRequests::FindEntity, newParentId);
|
||||
if (!newParentEntity)
|
||||
{
|
||||
AZ::Entity* newParentEntity = nullptr;
|
||||
AZ::ComponentApplicationBus::BroadcastResult(newParentEntity, &AZ::ComponentApplicationRequests::FindEntity, newParentId);
|
||||
if (!newParentEntity)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//reject dragging on to yourself or your children
|
||||
@@ -1344,14 +1344,15 @@ namespace AzToolsFramework
|
||||
emit EnableSelectionUpdates(false);
|
||||
auto parentIndex = GetIndexFromEntity(parentId);
|
||||
auto childIndex = GetIndexFromEntity(childId);
|
||||
beginRemoveRows(parentIndex, childIndex.row(), childIndex.row());
|
||||
beginResetModel();
|
||||
}
|
||||
|
||||
void EntityOutlinerListModel::OnEntityInfoUpdatedRemoveChildEnd(AZ::EntityId parentId, AZ::EntityId childId)
|
||||
{
|
||||
(void)childId;
|
||||
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
|
||||
endRemoveRows();
|
||||
|
||||
endResetModel();
|
||||
|
||||
//must refresh partial lock/visibility of parents
|
||||
m_isFilterDirty = true;
|
||||
|
||||
+34
-22
@@ -30,6 +30,7 @@
|
||||
#include <AzToolsFramework/Entity/EditorEntityHelpers.h>
|
||||
#include <AzToolsFramework/Entity/EditorEntityInfoBus.h>
|
||||
#include <AzToolsFramework/UI/ComponentPalette/ComponentPaletteUtil.hxx>
|
||||
#include <AzToolsFramework/UI/EditorEntityUi/EditorEntityUiHandlerBase.h>
|
||||
#include <AzToolsFramework/UI/Outliner/EntityOutlinerDisplayOptionsMenu.h>
|
||||
#include <AzToolsFramework/UI/Outliner/EntityOutlinerListModel.hxx>
|
||||
#include <AzToolsFramework/UI/Outliner/EntityOutlinerSortFilterProxyModel.hxx>
|
||||
@@ -271,6 +272,12 @@ namespace AzToolsFramework
|
||||
|
||||
m_listModel->Initialize();
|
||||
|
||||
m_editorEntityUiInterface = AZ::Interface<AzToolsFramework::EditorEntityUiInterface>::Get();
|
||||
|
||||
AZ_Assert(
|
||||
m_editorEntityUiInterface != nullptr,
|
||||
"EntityOutlinerWidget requires a EditorEntityUiInterface instance on Initialize.");
|
||||
|
||||
EditorPickModeNotificationBus::Handler::BusConnect(GetEntityContextId());
|
||||
EntityHighlightMessages::Bus::Handler::BusConnect();
|
||||
EntityOutlinerModelNotificationBus::Handler::BusConnect();
|
||||
@@ -279,12 +286,12 @@ namespace AzToolsFramework
|
||||
ComponentModeFramework::EditorComponentModeNotificationBus::Handler::BusConnect(
|
||||
GetEntityContextId());
|
||||
EditorEntityInfoNotificationBus::Handler::BusConnect();
|
||||
AZ::Interface<EntityOutlinerWidgetInterface>::Register(this);
|
||||
Prefab::PrefabPublicNotificationBus::Handler::BusConnect();
|
||||
}
|
||||
|
||||
EntityOutlinerWidget::~EntityOutlinerWidget()
|
||||
{
|
||||
AZ::Interface<EntityOutlinerWidgetInterface>::Unregister(this);
|
||||
Prefab::PrefabPublicNotificationBus::Handler::BusDisconnect();
|
||||
ComponentModeFramework::EditorComponentModeNotificationBus::Handler::BusDisconnect();
|
||||
EditorEntityInfoNotificationBus::Handler::BusDisconnect();
|
||||
EditorPickModeNotificationBus::Handler::BusDisconnect();
|
||||
@@ -562,7 +569,13 @@ namespace AzToolsFramework
|
||||
|
||||
if (m_selectedEntityIds.size() == 1)
|
||||
{
|
||||
contextMenu->addAction(m_actionToRenameSelection);
|
||||
auto entityId = m_selectedEntityIds.front();
|
||||
auto entityUiHandler = m_editorEntityUiInterface->GetHandler(entityId);
|
||||
|
||||
if (!entityUiHandler || entityUiHandler->CanRename(entityId))
|
||||
{
|
||||
contextMenu->addAction(m_actionToRenameSelection);
|
||||
}
|
||||
}
|
||||
|
||||
if (m_selectedEntityIds.size() == 1)
|
||||
@@ -688,11 +701,17 @@ namespace AzToolsFramework
|
||||
|
||||
if (m_selectedEntityIds.size() == 1)
|
||||
{
|
||||
const QModelIndex proxyIndex = GetIndexFromEntityId(m_selectedEntityIds.front());
|
||||
if (proxyIndex.isValid())
|
||||
auto entityId = m_selectedEntityIds.front();
|
||||
auto entityUiHandler = m_editorEntityUiInterface->GetHandler(entityId);
|
||||
|
||||
if (!entityUiHandler || entityUiHandler->CanRename(entityId))
|
||||
{
|
||||
m_gui->m_objectTree->setCurrentIndex(proxyIndex);
|
||||
m_gui->m_objectTree->QTreeView::edit(proxyIndex);
|
||||
const QModelIndex proxyIndex = GetIndexFromEntityId(entityId);
|
||||
if (proxyIndex.isValid())
|
||||
{
|
||||
m_gui->m_objectTree->setCurrentIndex(proxyIndex);
|
||||
m_gui->m_objectTree->QTreeView::edit(proxyIndex);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1090,25 +1109,18 @@ namespace AzToolsFramework
|
||||
setEnabled(true);
|
||||
SetEntityOutlinerState(m_gui, true);
|
||||
}
|
||||
|
||||
void EntityOutlinerWidget::SetUpdatesEnabled(bool enable)
|
||||
|
||||
void EntityOutlinerWidget::OnPrefabInstancePropagationBegin()
|
||||
{
|
||||
if (enable)
|
||||
{
|
||||
QTimer::singleShot(1, this, [this]() {
|
||||
m_gui->m_objectTree->setUpdatesEnabled(true);
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
m_gui->m_objectTree->setUpdatesEnabled(false);
|
||||
}
|
||||
m_gui->m_objectTree->setUpdatesEnabled(false);
|
||||
}
|
||||
|
||||
void EntityOutlinerWidget::ExpandEntityChildren(AZ::EntityId entityId)
|
||||
void EntityOutlinerWidget::OnPrefabInstancePropagationEnd()
|
||||
{
|
||||
QModelIndex index = GetIndexFromEntityId(entityId);
|
||||
m_gui->m_objectTree->expand(index);
|
||||
QTimer::singleShot(1, this, [this]() {
|
||||
m_gui->m_objectTree->setUpdatesEnabled(true);
|
||||
m_gui->m_objectTree->expand(m_proxyModel->index(0,0));
|
||||
});
|
||||
}
|
||||
|
||||
void EntityOutlinerWidget::OnEntityInfoUpdatedAddChildEnd(AZ::EntityId /*parentId*/, AZ::EntityId childId)
|
||||
|
||||
+8
-5
@@ -20,10 +20,10 @@
|
||||
#include <AzToolsFramework/ComponentMode/EditorComponentModeBus.h>
|
||||
#include <AzToolsFramework/Entity/EditorEntityInfoBus.h>
|
||||
#include <AzToolsFramework/Entity/EditorEntityContextBus.h>
|
||||
#include <AzToolsFramework/Prefab/PrefabPublicNotificationBus.h>
|
||||
#include <AzToolsFramework/ToolsMessaging/EntityHighlightBus.h>
|
||||
#include <AzToolsFramework/UI/Outliner/EntityOutlinerCacheBus.h>
|
||||
#include <AzToolsFramework/UI/Outliner/EntityOutlinerSearchWidget.h>
|
||||
#include <AzToolsFramework/UI/Outliner/EntityOutlinerWidgetInterface.h>
|
||||
#include <AzToolsFramework/UI/SearchWidget/SearchWidgetTypes.hxx>
|
||||
|
||||
#include <QIcon>
|
||||
@@ -42,6 +42,7 @@ namespace Ui
|
||||
|
||||
namespace AzToolsFramework
|
||||
{
|
||||
class EditorEntityUiInterface;
|
||||
class EntityOutlinerListModel;
|
||||
class EntityOutlinerSortFilterProxyModel;
|
||||
|
||||
@@ -61,7 +62,7 @@ namespace AzToolsFramework
|
||||
, private EditorEntityContextNotificationBus::Handler
|
||||
, private EditorEntityInfoNotificationBus::Handler
|
||||
, private ComponentModeFramework::EditorComponentModeNotificationBus::Handler
|
||||
, private EntityOutlinerWidgetInterface
|
||||
, private Prefab::PrefabPublicNotificationBus::Handler
|
||||
{
|
||||
Q_OBJECT;
|
||||
public:
|
||||
@@ -105,9 +106,9 @@ namespace AzToolsFramework
|
||||
void EnteredComponentMode(const AZStd::vector<AZ::Uuid>& componentModeTypes) override;
|
||||
void LeftComponentMode(const AZStd::vector<AZ::Uuid>& componentModeTypes) override;
|
||||
|
||||
// EntityOutlinerWidgetInterface
|
||||
void SetUpdatesEnabled(bool enable) override;
|
||||
void ExpandEntityChildren(AZ::EntityId entityId) override;
|
||||
// PrefabPublicNotificationBus
|
||||
void OnPrefabInstancePropagationBegin() override;
|
||||
void OnPrefabInstancePropagationEnd() override;
|
||||
|
||||
// Build a selection object from the given entities. Entities already in the Widget's selection buffers are ignored.
|
||||
template <class EntityIdCollection>
|
||||
@@ -193,6 +194,8 @@ namespace AzToolsFramework
|
||||
EntityIdSet m_entitiesToSort;
|
||||
EntityOutliner::DisplaySortMode m_sortMode;
|
||||
bool m_sortContentQueued;
|
||||
|
||||
EditorEntityUiInterface* m_editorEntityUiInterface = nullptr;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
-30
@@ -1,30 +0,0 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AzCore/Interface/Interface.h>
|
||||
#include <AzCore/Serialization/SerializeContext.h>
|
||||
|
||||
namespace AzToolsFramework
|
||||
{
|
||||
class EntityOutlinerWidgetInterface
|
||||
{
|
||||
public:
|
||||
AZ_RTTI(EntityOutlinerWidgetInterface, "{30C0F252-EC84-4196-BF59-EB9E73B8ADCB}");
|
||||
|
||||
virtual void SetUpdatesEnabled(bool enable) = 0;
|
||||
virtual void ExpandEntityChildren(AZ::EntityId entityId) = 0;
|
||||
};
|
||||
|
||||
} // namespace AzToolsFramework
|
||||
|
||||
@@ -50,11 +50,31 @@ namespace AzToolsFramework
|
||||
return QPixmap(m_levelRootIconPath);
|
||||
}
|
||||
|
||||
QString LevelRootUiHandler::GenerateItemInfoString(AZ::EntityId entityId) const
|
||||
{
|
||||
QString infoString;
|
||||
|
||||
AZ::IO::Path path = m_prefabPublicInterface->GetOwningInstancePrefabPath(entityId);
|
||||
|
||||
if (!path.empty())
|
||||
{
|
||||
infoString =
|
||||
QObject::tr("<span style=\"font-style: italic; font-weight: 400;\">(%1)</span>").arg(path.Filename().Native().data());
|
||||
}
|
||||
|
||||
return infoString;
|
||||
}
|
||||
|
||||
bool LevelRootUiHandler::CanToggleLockVisibility(AZ::EntityId /*entityId*/) const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool LevelRootUiHandler::CanRename(AZ::EntityId /*entityId*/) const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void LevelRootUiHandler::PaintItemBackground(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& /*index*/) const
|
||||
{
|
||||
if (!painter)
|
||||
|
||||
@@ -34,7 +34,9 @@ namespace AzToolsFramework
|
||||
|
||||
// EditorEntityUiHandler...
|
||||
QPixmap GenerateItemIcon(AZ::EntityId entityId) const override;
|
||||
QString GenerateItemInfoString(AZ::EntityId entityId) const override;
|
||||
bool CanToggleLockVisibility(AZ::EntityId entityId) const override;
|
||||
bool CanRename(AZ::EntityId entityId) const override;
|
||||
void PaintItemBackground(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const override;
|
||||
|
||||
private:
|
||||
|
||||
+1
-1
@@ -118,4 +118,4 @@ namespace AzToolsFramework
|
||||
}
|
||||
}
|
||||
|
||||
#include "UI/PropertyEditor/moc_ComponentEditorHeader.cpp"
|
||||
#include "UI/PropertyEditor/moc_ComponentEditorHeader.cpp"
|
||||
|
||||
@@ -58,4 +58,4 @@ namespace AzToolsFramework
|
||||
slider->setFocusPolicy(Qt::StrongFocus);
|
||||
slider->setFocusProxy(spinbox);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,4 +43,4 @@ namespace AzToolsFramework
|
||||
void InitializeSliderPropertyWidgets(QSlider*, QAbstractSpinBox*);
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
+1
-1
@@ -98,4 +98,4 @@ namespace AzToolsFramework
|
||||
}
|
||||
}
|
||||
|
||||
#include "UI/PropertyEditor/moc_EntityIdQLabel.cpp"
|
||||
#include "UI/PropertyEditor/moc_EntityIdQLabel.cpp"
|
||||
|
||||
+47
-10
@@ -310,6 +310,9 @@ namespace AzToolsFramework
|
||||
{
|
||||
initEntityPropertyEditorResources();
|
||||
|
||||
m_prefabPublicInterface = AZ::Interface<Prefab::PrefabPublicInterface>::Get();
|
||||
AZ_Assert(m_prefabPublicInterface != nullptr, "EntityPropertyEditor requires a PrefabPublicInterface instance on Initialize.");
|
||||
|
||||
setObjectName("EntityPropertyEditor");
|
||||
setAcceptDrops(true);
|
||||
|
||||
@@ -405,8 +408,6 @@ namespace AzToolsFramework
|
||||
CreateActions();
|
||||
UpdateContents();
|
||||
|
||||
m_prefabPublicInterface = AZ::Interface<Prefab::PrefabPublicInterface>::Get();
|
||||
|
||||
EditorEntityContextNotificationBus::Handler::BusConnect();
|
||||
|
||||
//forced to register global event filter with application for selection
|
||||
@@ -693,11 +694,38 @@ namespace AzToolsFramework
|
||||
m_gui->m_entityIcon->repaint();
|
||||
}
|
||||
|
||||
EntityPropertyEditor::InspectorLayout EntityPropertyEditor::GetCurrentInspectorLayout() const
|
||||
{
|
||||
if (!m_prefabsAreEnabled)
|
||||
{
|
||||
return m_isLevelEntityEditor ? InspectorLayout::LEVEL : InspectorLayout::ENTITY;
|
||||
}
|
||||
|
||||
AZ::EntityId levelContainerEntityId = m_prefabPublicInterface->GetLevelInstanceContainerEntityId();
|
||||
if (AZStd::find(m_selectedEntityIds.begin(), m_selectedEntityIds.end(), levelContainerEntityId) != m_selectedEntityIds.end())
|
||||
{
|
||||
if (m_selectedEntityIds.size() > 1)
|
||||
{
|
||||
return InspectorLayout::INVALID;
|
||||
}
|
||||
else
|
||||
{
|
||||
return InspectorLayout::LEVEL;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return InspectorLayout::ENTITY;
|
||||
}
|
||||
}
|
||||
|
||||
void EntityPropertyEditor::UpdateEntityDisplay()
|
||||
{
|
||||
UpdateStatusComboBox();
|
||||
|
||||
if (m_isLevelEntityEditor)
|
||||
InspectorLayout layout = GetCurrentInspectorLayout();
|
||||
|
||||
if (layout == InspectorLayout::LEVEL)
|
||||
{
|
||||
AZStd::string levelName;
|
||||
AzToolsFramework::EditorRequestBus::BroadcastResult(levelName, &AzToolsFramework::EditorRequests::GetLevelName);
|
||||
@@ -737,13 +765,20 @@ namespace AzToolsFramework
|
||||
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
|
||||
SelectionEntityTypeInfo result = SelectionEntityTypeInfo::None;
|
||||
|
||||
if (m_isLevelEntityEditor)
|
||||
InspectorLayout layout = GetCurrentInspectorLayout();
|
||||
|
||||
if (layout == InspectorLayout::LEVEL)
|
||||
{
|
||||
// The Level Inspector should only have a list of selectable components after the
|
||||
// level entity itself is valid (i.e. "selected").
|
||||
return selection.empty() ? SelectionEntityTypeInfo::None : SelectionEntityTypeInfo::LevelEntity;
|
||||
}
|
||||
|
||||
if (layout == InspectorLayout::INVALID)
|
||||
{
|
||||
return SelectionEntityTypeInfo::Mixed;
|
||||
}
|
||||
|
||||
for (AZ::EntityId selectedEntityId : selection)
|
||||
{
|
||||
bool isLayerEntity = false;
|
||||
@@ -909,16 +944,18 @@ namespace AzToolsFramework
|
||||
}
|
||||
}
|
||||
|
||||
bool isLevelLayout = GetCurrentInspectorLayout() == InspectorLayout::LEVEL;
|
||||
|
||||
m_gui->m_entityDetailsLabel->setText(entityDetailsLabelText);
|
||||
m_gui->m_entityDetailsLabel->setVisible(entityDetailsVisible);
|
||||
m_gui->m_entityNameEditor->setVisible(hasEntitiesDisplayed);
|
||||
m_gui->m_entityNameLabel->setVisible(hasEntitiesDisplayed);
|
||||
m_gui->m_entityIcon->setVisible(hasEntitiesDisplayed);
|
||||
m_gui->m_pinButton->setVisible(m_overrideSelectedEntityIds.empty() && hasEntitiesDisplayed && !m_isSystemEntityEditor && !m_isLevelEntityEditor);
|
||||
m_gui->m_statusLabel->setVisible(hasEntitiesDisplayed && !m_isSystemEntityEditor && !m_isLevelEntityEditor);
|
||||
m_gui->m_statusComboBox->setVisible(hasEntitiesDisplayed && !m_isSystemEntityEditor && !m_isLevelEntityEditor);
|
||||
m_gui->m_entityIdLabel->setVisible(hasEntitiesDisplayed && !m_isSystemEntityEditor && !m_isLevelEntityEditor);
|
||||
m_gui->m_entityIdText->setVisible(hasEntitiesDisplayed && !m_isSystemEntityEditor && !m_isLevelEntityEditor);
|
||||
m_gui->m_pinButton->setVisible(m_overrideSelectedEntityIds.empty() && hasEntitiesDisplayed && !m_isSystemEntityEditor);
|
||||
m_gui->m_statusLabel->setVisible(hasEntitiesDisplayed && !m_isSystemEntityEditor && !isLevelLayout);
|
||||
m_gui->m_statusComboBox->setVisible(hasEntitiesDisplayed && !m_isSystemEntityEditor && !isLevelLayout);
|
||||
m_gui->m_entityIdLabel->setVisible(hasEntitiesDisplayed && !m_isSystemEntityEditor && !isLevelLayout);
|
||||
m_gui->m_entityIdText->setVisible(hasEntitiesDisplayed && !m_isSystemEntityEditor && !isLevelLayout);
|
||||
|
||||
bool displayComponentSearchBox = hasEntitiesDisplayed;
|
||||
if (hasEntitiesDisplayed)
|
||||
@@ -941,7 +978,7 @@ namespace AzToolsFramework
|
||||
UpdateEntityDisplay();
|
||||
}
|
||||
|
||||
m_gui->m_darkBox->setVisible(displayComponentSearchBox && !m_isSystemEntityEditor && !m_isLevelEntityEditor);
|
||||
m_gui->m_darkBox->setVisible(displayComponentSearchBox && !m_isSystemEntityEditor && !isLevelLayout);
|
||||
m_gui->m_entitySearchBox->setVisible(displayComponentSearchBox);
|
||||
|
||||
bool displayAddComponentMenu = CanAddComponentsToSelection(selectionEntityTypeInfo);
|
||||
|
||||
+9
@@ -521,6 +521,15 @@ namespace AzToolsFramework
|
||||
bool m_isSystemEntityEditor;
|
||||
bool m_isLevelEntityEditor = false;
|
||||
|
||||
enum class InspectorLayout
|
||||
{
|
||||
ENTITY = 0, // All selected entities are regular entities
|
||||
LEVEL, // The selected entity is the level prefab container entity
|
||||
INVALID // Other entities are selected alongside the level prefab container entity
|
||||
};
|
||||
|
||||
InspectorLayout GetCurrentInspectorLayout() const;
|
||||
|
||||
// the spacer's job is to make sure that its always at the end of the list of components.
|
||||
QSpacerItem* m_spacer;
|
||||
bool m_isAlreadyQueuedRefresh;
|
||||
|
||||
@@ -86,4 +86,4 @@ namespace AzToolsFramework
|
||||
}
|
||||
}
|
||||
|
||||
#include "UI/PropertyEditor/moc_GrowTextEdit.cpp"
|
||||
#include "UI/PropertyEditor/moc_GrowTextEdit.cpp"
|
||||
|
||||
+1
-1
@@ -53,4 +53,4 @@ namespace AzToolsFramework
|
||||
};
|
||||
|
||||
void RegisterMultiLineEditHandler();
|
||||
}
|
||||
}
|
||||
|
||||
+58
-29
@@ -38,6 +38,7 @@ AZ_POP_DISABLE_WARNING
|
||||
#include <AzCore/Asset/AssetManager.h>
|
||||
#include <AzCore/Component/ComponentApplicationBus.h>
|
||||
#include <AzCore/Asset/AssetTypeInfoBus.h>
|
||||
#include <AzCore/Utils/Utils.h>
|
||||
#include <AzFramework/StringFunc/StringFunc.h>
|
||||
#include <AzFramework/Asset/SimpleAsset.h>
|
||||
#include <AzFramework/Asset/AssetCatalogBus.h>
|
||||
@@ -62,7 +63,7 @@ AZ_POP_DISABLE_WARNING
|
||||
|
||||
#include <UI/PropertyEditor/Model/AssetCompleterModel.h>
|
||||
#include <UI/PropertyEditor/View/AssetCompleterListView.h>
|
||||
#include <UI/PropertyEditor/ThumbnailDropDown.h>
|
||||
#include <UI/PropertyEditor/ThumbnailPropertyCtrl.h>
|
||||
|
||||
namespace AzToolsFramework
|
||||
{
|
||||
@@ -92,15 +93,11 @@ namespace AzToolsFramework
|
||||
|
||||
setAcceptDrops(true);
|
||||
|
||||
m_thumbnail = new Thumbnailer::ThumbnailWidget(this);
|
||||
m_thumbnail->setFixedSize(QSize(24, 24));
|
||||
m_thumbnail = new ThumbnailPropertyCtrl(this);
|
||||
m_thumbnail->setFixedSize(QSize(40, 24));
|
||||
m_thumbnail->setVisible(false);
|
||||
|
||||
m_thumbnailDropDown = new ThumbnailDropDown(this);
|
||||
m_thumbnailDropDown->setFixedSize(QSize(40, 24));
|
||||
m_thumbnailDropDown->setVisible(false);
|
||||
|
||||
connect(m_thumbnailDropDown, &ThumbnailDropDown::clicked, this, &PropertyAssetCtrl::OnEditButtonClicked);
|
||||
connect(m_thumbnail, &ThumbnailPropertyCtrl::clicked, this, &PropertyAssetCtrl::OnThumbnailClicked);
|
||||
|
||||
m_editButton = new QToolButton(this);
|
||||
m_editButton->setAutoRaise(true);
|
||||
@@ -111,7 +108,6 @@ namespace AzToolsFramework
|
||||
connect(m_editButton, &QToolButton::clicked, this, &PropertyAssetCtrl::OnEditButtonClicked);
|
||||
|
||||
pLayout->addWidget(m_thumbnail);
|
||||
pLayout->addWidget(m_thumbnailDropDown);
|
||||
pLayout->addWidget(m_browseEdit);
|
||||
pLayout->addWidget(m_editButton);
|
||||
|
||||
@@ -187,6 +183,17 @@ namespace AzToolsFramework
|
||||
}
|
||||
}
|
||||
|
||||
void PropertyAssetCtrl::OnThumbnailClicked()
|
||||
{
|
||||
const AZ::Data::AssetId assetID = GetCurrentAssetID();
|
||||
if (m_thumbnailCallback)
|
||||
{
|
||||
AZ_Error("Asset Property", m_editNotifyTarget, "No notification target set for edit callback.");
|
||||
m_thumbnailCallback->Invoke(m_editNotifyTarget, assetID, GetCurrentAssetType());
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void PropertyAssetCtrl::OnCompletionModelReset()
|
||||
{
|
||||
if (!m_completerIsActive)
|
||||
@@ -537,7 +544,7 @@ namespace AzToolsFramework
|
||||
m_errorButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
|
||||
m_errorButton->setFixedSize(QSize(16, 16));
|
||||
m_errorButton->setMouseTracking(true);
|
||||
m_errorButton->setIcon(QIcon("Editor/Icons/PropertyEditor/error_icon.png"));
|
||||
m_errorButton->setIcon(QIcon("Icons/PropertyEditor/error_icon.png"));
|
||||
m_errorButton->setToolTip("Show Errors");
|
||||
|
||||
// Insert the error button after the asset label
|
||||
@@ -673,6 +680,13 @@ namespace AzToolsFramework
|
||||
AzQtComponents::BrowseEdit::removeDropTargetStyle(m_browseEdit);
|
||||
}
|
||||
|
||||
AssetSelectionModel PropertyAssetCtrl::GetAssetSelectionModel()
|
||||
{
|
||||
auto selectionModel = AssetSelectionModel::AssetTypeSelection(GetCurrentAssetType());
|
||||
selectionModel.SetTitle(m_title);
|
||||
return selectionModel;
|
||||
}
|
||||
|
||||
void PropertyAssetCtrl::UpdateTabOrder()
|
||||
{
|
||||
setTabOrder(m_browseEdit, m_editButton);
|
||||
@@ -1051,6 +1065,11 @@ namespace AzToolsFramework
|
||||
m_editButton->setIcon(icon);
|
||||
}
|
||||
|
||||
void PropertyAssetCtrl::SetTitle(const QString& title)
|
||||
{
|
||||
m_title = title;
|
||||
}
|
||||
|
||||
void PropertyAssetCtrl::SetEditNotifyTarget(void* editNotifyTarget)
|
||||
{
|
||||
m_editNotifyTarget = editNotifyTarget;
|
||||
@@ -1090,10 +1109,10 @@ namespace AzToolsFramework
|
||||
void PropertyAssetCtrl::UpdateThumbnail()
|
||||
{
|
||||
m_thumbnail->setVisible(m_showThumbnail);
|
||||
m_thumbnailDropDown->setVisible(m_showThumbnailDropDown);
|
||||
|
||||
if (m_showThumbnail || m_showThumbnailDropDown)
|
||||
if (m_showThumbnail)
|
||||
{
|
||||
m_thumbnail->ShowDropDownArrow(m_showThumbnailDropDownButton);
|
||||
const AZ::Data::AssetId assetID = GetCurrentAssetID();
|
||||
if (assetID.IsValid())
|
||||
{
|
||||
@@ -1111,17 +1130,12 @@ namespace AzToolsFramework
|
||||
{
|
||||
m_thumbnail->SetThumbnailKey(thumbnailKey, Thumbnailer::ThumbnailContext::DefaultContext);
|
||||
}
|
||||
if (m_showThumbnailDropDown)
|
||||
{
|
||||
m_thumbnailDropDown->SetThumbnailKey(thumbnailKey, Thumbnailer::ThumbnailContext::DefaultContext);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
m_thumbnail->ClearThumbnail();
|
||||
m_thumbnailDropDown->ClearThumbnail();
|
||||
}
|
||||
|
||||
void PropertyAssetCtrl::SetClearButtonEnabled(bool enable)
|
||||
@@ -1155,14 +1169,19 @@ namespace AzToolsFramework
|
||||
return m_showThumbnail;
|
||||
}
|
||||
|
||||
void PropertyAssetCtrl::SetShowThumbnailDropDown(bool enable)
|
||||
void PropertyAssetCtrl::SetShowThumbnailDropDownButton(bool enable)
|
||||
{
|
||||
m_showThumbnailDropDown = enable;
|
||||
m_showThumbnailDropDownButton = enable;
|
||||
}
|
||||
|
||||
bool PropertyAssetCtrl::GetShowThumbnailDropDown() const
|
||||
bool PropertyAssetCtrl::GetShowThumbnailDropDownButton() const
|
||||
{
|
||||
return m_showThumbnailDropDown;
|
||||
return m_showThumbnailDropDownButton;
|
||||
}
|
||||
|
||||
void PropertyAssetCtrl::SetThumbnailCallback(EditCallbackType* editNotifyCallback)
|
||||
{
|
||||
m_thumbnailCallback = editNotifyCallback;
|
||||
}
|
||||
|
||||
const AZ::Uuid& AssetPropertyHandlerDefault::GetHandledType() const
|
||||
@@ -1186,7 +1205,16 @@ namespace AzToolsFramework
|
||||
{
|
||||
(void)debugName;
|
||||
|
||||
if (attrib == AZ_CRC("EditCallback", 0xb74f2ee1))
|
||||
if (attrib == AZ_CRC_CE("AssetPickerTitle"))
|
||||
{
|
||||
AZStd::string title;
|
||||
attrValue->Read<AZStd::string>(title);
|
||||
if (!title.empty())
|
||||
{
|
||||
GUI->SetTitle(title.c_str());
|
||||
}
|
||||
}
|
||||
else if (attrib == AZ_CRC("EditCallback", 0xb74f2ee1))
|
||||
{
|
||||
PropertyAssetCtrl::EditCallbackType* func = azdynamic_cast<PropertyAssetCtrl::EditCallbackType*>(attrValue->GetAttribute());
|
||||
if (func)
|
||||
@@ -1212,9 +1240,8 @@ namespace AzToolsFramework
|
||||
|
||||
if (!QFile::exists(path))
|
||||
{
|
||||
const char* engineRoot = nullptr;
|
||||
AzToolsFramework::ToolsApplicationRequestBus::BroadcastResult(engineRoot, &AzToolsFramework::ToolsApplicationRequests::GetEngineRootPath);
|
||||
QDir engineDir = engineRoot ? QDir(engineRoot) : QDir::current();
|
||||
AZ::IO::FixedMaxPathString engineRoot = AZ::Utils::GetEnginePath();
|
||||
QDir engineDir = !engineRoot.empty() ? QDir(QString(engineRoot.c_str())) : QDir::current();
|
||||
|
||||
path = engineDir.absoluteFilePath(iconPath.c_str());
|
||||
}
|
||||
@@ -1283,17 +1310,19 @@ namespace AzToolsFramework
|
||||
GUI->SetShowThumbnail(showThumbnail);
|
||||
}
|
||||
}
|
||||
else if (attrib == AZ_CRC_CE("ThumbnailWithDropDown"))
|
||||
else if (attrib == AZ_CRC_CE("ThumbnailCallback"))
|
||||
{
|
||||
PropertyAssetCtrl::EditCallbackType* func = azdynamic_cast<PropertyAssetCtrl::EditCallbackType*>(attrValue->GetAttribute());
|
||||
if (func)
|
||||
{
|
||||
GUI->SetShowThumbnailDropDown(true);
|
||||
GUI->SetEditNotifyCallback(func);
|
||||
GUI->SetShowThumbnail(true);
|
||||
GUI->SetShowThumbnailDropDownButton(true);
|
||||
GUI->SetThumbnailCallback(func);
|
||||
}
|
||||
else
|
||||
{
|
||||
GUI->SetEditNotifyCallback(nullptr);
|
||||
GUI->SetShowThumbnailDropDownButton(false);
|
||||
GUI->SetThumbnailCallback(nullptr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+11
-8
@@ -45,7 +45,7 @@ namespace AzToolsFramework
|
||||
{
|
||||
class AssetCompleterModel;
|
||||
class AssetCompleterListView;
|
||||
class ThumbnailDropDown;
|
||||
class ThumbnailPropertyCtrl;
|
||||
|
||||
namespace Thumbnailer
|
||||
{
|
||||
@@ -89,14 +89,14 @@ namespace AzToolsFramework
|
||||
void dragLeaveEvent(QDragLeaveEvent* event) override;
|
||||
void dropEvent(QDropEvent* event) override;
|
||||
|
||||
virtual AssetSelectionModel GetAssetSelectionModel() { return AssetSelectionModel::AssetTypeSelection(GetCurrentAssetType()); }
|
||||
virtual AssetSelectionModel GetAssetSelectionModel();
|
||||
|
||||
signals:
|
||||
void OnAssetIDChanged(AZ::Data::AssetId newAssetID);
|
||||
|
||||
protected:
|
||||
ThumbnailDropDown* m_thumbnailDropDown = nullptr;
|
||||
Thumbnailer::ThumbnailWidget* m_thumbnail = nullptr;
|
||||
QString m_title;
|
||||
ThumbnailPropertyCtrl* m_thumbnail = nullptr;
|
||||
QPushButton* m_errorButton = nullptr;
|
||||
QToolButton* m_editButton = nullptr;
|
||||
|
||||
@@ -157,8 +157,8 @@ namespace AzToolsFramework
|
||||
bool m_showProductAssetName = true;
|
||||
|
||||
bool m_showThumbnail = false;
|
||||
|
||||
bool m_showThumbnailDropDown = false;
|
||||
bool m_showThumbnailDropDownButton = false;
|
||||
EditCallbackType* m_thumbnailCallback = nullptr;
|
||||
|
||||
// ! Default suffix used in the field's placeholder text when a default value is set.
|
||||
const char* m_DefaultSuffix = " (default)";
|
||||
@@ -192,6 +192,7 @@ namespace AzToolsFramework
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
public slots:
|
||||
void SetTitle(const QString& title);
|
||||
void SetEditNotifyTarget(void* editNotifyTarget);
|
||||
void SetEditNotifyCallback(EditCallbackType* editNotifyCallback); // This is meant to be used with the "EditCallback" Attribute
|
||||
void SetClearNotifyCallback(ClearCallbackType* clearNotifyCallback); // This is meant to be used with the "ClearNotify" Attribute
|
||||
@@ -209,8 +210,9 @@ namespace AzToolsFramework
|
||||
|
||||
void SetShowThumbnail(bool enable);
|
||||
bool GetShowThumbnail() const;
|
||||
void SetShowThumbnailDropDown(bool enable);
|
||||
bool GetShowThumbnailDropDown() const;
|
||||
void SetShowThumbnailDropDownButton(bool enable);
|
||||
bool GetShowThumbnailDropDownButton() const;
|
||||
void SetThumbnailCallback(EditCallbackType* editNotifyCallback);
|
||||
|
||||
void SetSelectedAssetID(const AZ::Data::AssetId& newID);
|
||||
void SetCurrentAssetType(const AZ::Data::AssetType& newType);
|
||||
@@ -222,6 +224,7 @@ namespace AzToolsFramework
|
||||
void UpdateAssetDisplay();
|
||||
void OnLineEditFocus(bool focus);
|
||||
virtual void OnEditButtonClicked();
|
||||
void OnThumbnailClicked();
|
||||
void OnCompletionModelReset();
|
||||
void OnAutocomplete(const QModelIndex& index);
|
||||
void OnTextChange(const QString& text);
|
||||
|
||||
+1
-1
@@ -347,4 +347,4 @@ namespace AzToolsFramework
|
||||
}
|
||||
} // namespace AzToolsFramework
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
+10
-16
@@ -121,17 +121,14 @@ namespace AzToolsFramework
|
||||
EditorPickModeRequestBus::Handler::BusConnect(pickModeEntityContextId);
|
||||
EditorEventsBus::Handler::BusConnect();
|
||||
|
||||
if (IsNewViewportInteractionModelEnabled())
|
||||
// replace the default input handler with one specific for dealing with
|
||||
// entity selection in the viewport
|
||||
EditorInteractionSystemViewportSelectionRequestBus::Event(
|
||||
GetEntityContextId(), &EditorInteractionSystemViewportSelection::SetHandler,
|
||||
[](const EditorVisibleEntityDataCache* entityDataCache)
|
||||
{
|
||||
// replace the default input handler with one specific for dealing with
|
||||
// entity selection in the viewport
|
||||
EditorInteractionSystemViewportSelectionRequestBus::Event(
|
||||
GetEntityContextId(), &EditorInteractionSystemViewportSelection::SetHandler,
|
||||
[](const EditorVisibleEntityDataCache* entityDataCache)
|
||||
{
|
||||
return AZStd::make_unique<EditorPickEntitySelection>(entityDataCache);
|
||||
});
|
||||
}
|
||||
return AZStd::make_unique<EditorPickEntitySelection>(entityDataCache);
|
||||
});
|
||||
|
||||
if (!pickModeEntityContextId.IsNull())
|
||||
{
|
||||
@@ -162,12 +159,9 @@ namespace AzToolsFramework
|
||||
EditorEventsBus::Handler::BusDisconnect();
|
||||
emit OnPickComplete();
|
||||
|
||||
if (IsNewViewportInteractionModelEnabled())
|
||||
{
|
||||
// return to the default viewport editor selection
|
||||
EditorInteractionSystemViewportSelectionRequestBus::Event(
|
||||
GetEntityContextId(), &EditorInteractionSystemViewportSelection::SetDefaultHandler);
|
||||
}
|
||||
// return to the default viewport editor selection
|
||||
EditorInteractionSystemViewportSelectionRequestBus::Event(
|
||||
GetEntityContextId(), &EditorInteractionSystemViewportSelection::SetDefaultHandler);
|
||||
|
||||
EditorPickModeNotificationBus::Broadcast(&EditorPickModeNotifications::OnEntityPickModeStopped);
|
||||
}
|
||||
|
||||
+1
-1
@@ -7,4 +7,4 @@
|
||||
<g id="icon-/-outliner-/-entity-/-Default---Saved" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<path d="M13.69163,3.24686842 L8.01783965,6.52512131 L2.34404932,3.24686842 L8,0.481790242 L13.69163,3.24686842 Z M7.25035308,7.82264135 L7.25035308,14.7689324 L1.9912897,11.7236967 L1.9912897,4.79310939 L7.25035308,7.82264135 Z M14.0326515,11.6884321 L8.74360561,14.7769163 L8.74360561,7.8257203 L14.0024918,4.79949203 L14.0326515,11.6884321 Z" id="Shape" fill="#4285F4" fill-rule="nonzero"></path>
|
||||
</g>
|
||||
</svg>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 927 B After Width: | Height: | Size: 928 B |
+1
-1
@@ -10,4 +10,4 @@
|
||||
<path d="M11.9999166,9.73463536 C13.6052347,11.1311262 14.1508753,12.7679159 14.257424,13.505867 C13.6491663,13.505867 8.62210474,13.5009029 8.19563964,13.505867 C8.19563964,12.3483124 8.19563964,9.55037517 8.19563964,8.0672756 C8.34990272,8.0672756 10.2176801,8.18424048 11.9999166,9.73463536 Z" id="Triangle-2" transform="translate(11.226532, 10.786571) rotate(90.000000) translate(-11.226532, -10.786571) "></path>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
+1
-1
@@ -10,4 +10,4 @@
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
+42
-9
@@ -19,12 +19,14 @@ AZ_PUSH_DISABLE_WARNING(4251 4800, "-Wunknown-warning-option") // 4251: 'QRawFon
|
||||
#include <QPainter>
|
||||
#include <UI/UICore/AspectRatioAwarePixmapWidget.hxx>
|
||||
#include <Thumbnails/ThumbnailWidget.h>
|
||||
#include <QApplication>
|
||||
AZ_POP_DISABLE_WARNING
|
||||
#include "ThumbnailDropDown.h"
|
||||
#include "ThumbnailPropertyCtrl.h"
|
||||
|
||||
namespace AzToolsFramework
|
||||
{
|
||||
ThumbnailDropDown::ThumbnailDropDown(QWidget* parent)
|
||||
|
||||
ThumbnailPropertyCtrl::ThumbnailPropertyCtrl(QWidget* parent)
|
||||
: QWidget(parent)
|
||||
{
|
||||
QHBoxLayout* pLayout = new QHBoxLayout();
|
||||
@@ -37,6 +39,7 @@ namespace AzToolsFramework
|
||||
m_dropDownArrow = new AspectRatioAwarePixmapWidget(this);
|
||||
m_dropDownArrow->setPixmap(QPixmap(":/stylesheet/img/triangle0.png"));
|
||||
m_dropDownArrow->setFixedSize(QSize(8, 24));
|
||||
ShowDropDownArrow(false);
|
||||
|
||||
m_emptyThumbnail = new QLabel(this);
|
||||
m_emptyThumbnail->setPixmap(QPixmap(":/stylesheet/img/line.png"));
|
||||
@@ -51,19 +54,33 @@ namespace AzToolsFramework
|
||||
setLayout(pLayout);
|
||||
}
|
||||
|
||||
void ThumbnailDropDown::SetThumbnailKey(Thumbnailer::SharedThumbnailKey key, const char* contextName)
|
||||
void ThumbnailPropertyCtrl::SetThumbnailKey(Thumbnailer::SharedThumbnailKey key, const char* contextName)
|
||||
{
|
||||
m_key = key;
|
||||
m_emptyThumbnail->setVisible(false);
|
||||
m_thumbnail->SetThumbnailKey(key, contextName);
|
||||
}
|
||||
|
||||
void ThumbnailDropDown::ClearThumbnail()
|
||||
void ThumbnailPropertyCtrl::ClearThumbnail()
|
||||
{
|
||||
m_emptyThumbnail->setVisible(true);
|
||||
m_thumbnail->ClearThumbnail();
|
||||
}
|
||||
|
||||
bool ThumbnailDropDown::event(QEvent* e)
|
||||
void ThumbnailPropertyCtrl::ShowDropDownArrow(bool visible)
|
||||
{
|
||||
if (visible)
|
||||
{
|
||||
setFixedSize(QSize(40, 24));
|
||||
}
|
||||
else
|
||||
{
|
||||
setFixedSize(QSize(24, 24));
|
||||
}
|
||||
m_dropDownArrow->setVisible(visible);
|
||||
}
|
||||
|
||||
bool ThumbnailPropertyCtrl::event(QEvent* e)
|
||||
{
|
||||
if (isEnabled())
|
||||
{
|
||||
@@ -77,7 +94,7 @@ namespace AzToolsFramework
|
||||
return QWidget::event(e);
|
||||
}
|
||||
|
||||
void ThumbnailDropDown::paintEvent(QPaintEvent* e)
|
||||
void ThumbnailPropertyCtrl::paintEvent(QPaintEvent* e)
|
||||
{
|
||||
QPainter p(this);
|
||||
QRect targetRect(QPoint(), QSize(40, 24));
|
||||
@@ -85,17 +102,33 @@ namespace AzToolsFramework
|
||||
QWidget::paintEvent(e);
|
||||
}
|
||||
|
||||
void ThumbnailDropDown::enterEvent(QEvent* e)
|
||||
void ThumbnailPropertyCtrl::enterEvent(QEvent* e)
|
||||
{
|
||||
m_dropDownArrow->setPixmap(QPixmap(":/stylesheet/img/triangle0_highlighted.png"));
|
||||
if (!m_thumbnailEnlarged && m_key)
|
||||
{
|
||||
QPoint position = mapToGlobal(pos() - QPoint(185, 0));
|
||||
QSize size(180, 180);
|
||||
m_thumbnailEnlarged.reset(new Thumbnailer::ThumbnailWidget());
|
||||
m_thumbnailEnlarged->setFixedSize(size);
|
||||
m_thumbnailEnlarged->move(position);
|
||||
m_thumbnailEnlarged->setWindowFlags(Qt::Window | Qt::FramelessWindowHint);
|
||||
m_thumbnailEnlarged->SetThumbnailKey(m_key);
|
||||
m_thumbnailEnlarged->raise();
|
||||
m_thumbnailEnlarged->show();
|
||||
}
|
||||
QWidget::enterEvent(e);
|
||||
}
|
||||
|
||||
void ThumbnailDropDown::leaveEvent(QEvent* e)
|
||||
void ThumbnailPropertyCtrl::leaveEvent(QEvent* e)
|
||||
{
|
||||
m_dropDownArrow->setPixmap(QPixmap(":/stylesheet/img/triangle0.png"));
|
||||
if (m_thumbnailEnlarged)
|
||||
{
|
||||
m_thumbnailEnlarged.reset();
|
||||
}
|
||||
QWidget::leaveEvent(e);
|
||||
}
|
||||
}
|
||||
|
||||
#include "UI/PropertyEditor/moc_ThumbnailDropDown.cpp"
|
||||
#include "UI/PropertyEditor/moc_ThumbnailPropertyCtrl.cpp"
|
||||
+7
-2
@@ -30,17 +30,20 @@ namespace AzToolsFramework
|
||||
class ThumbnailWidget;
|
||||
}
|
||||
|
||||
class ThumbnailDropDown : public QWidget
|
||||
//! Used by PropertyAssetCtrl to display thumbnail preview of the asset as well as additional drop-down actions
|
||||
class ThumbnailPropertyCtrl : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit ThumbnailDropDown(QWidget* parent = nullptr);
|
||||
explicit ThumbnailPropertyCtrl(QWidget* parent = nullptr);
|
||||
|
||||
//! Call this to set what thumbnail widget will display
|
||||
void SetThumbnailKey(Thumbnailer::SharedThumbnailKey key, const char* contextName = "Default");
|
||||
//! Remove current thumbnail
|
||||
void ClearThumbnail();
|
||||
|
||||
void ShowDropDownArrow(bool visible);
|
||||
|
||||
bool event(QEvent* e) override;
|
||||
|
||||
Q_SIGNALS:
|
||||
@@ -52,7 +55,9 @@ namespace AzToolsFramework
|
||||
void leaveEvent(QEvent* e) override;
|
||||
|
||||
private:
|
||||
Thumbnailer::SharedThumbnailKey m_key;
|
||||
Thumbnailer::ThumbnailWidget* m_thumbnail = nullptr;
|
||||
QScopedPointer<Thumbnailer::ThumbnailWidget> m_thumbnailEnlarged;
|
||||
QLabel* m_emptyThumbnail = nullptr;
|
||||
AspectRatioAwarePixmapWidget* m_dropDownArrow = nullptr;
|
||||
};
|
||||
+6
-6
@@ -70,7 +70,7 @@ namespace AzToolsFramework
|
||||
m_tagLabel->setMinimumSize(24, 22);
|
||||
m_tagLabel->setAttribute(Qt::WA_TransparentForMouseEvents, true);
|
||||
|
||||
QIcon closeIcon("Editor/Icons/animation/close.png");
|
||||
QIcon closeIcon("Icons/animation/close.png");
|
||||
|
||||
QPushButton* button = new QPushButton(this);
|
||||
button->setStyleSheet(button->styleSheet() + "border: 0px;");
|
||||
@@ -233,14 +233,14 @@ namespace AzToolsFramework
|
||||
QPushButton* loadButton = new QPushButton(this);
|
||||
loadButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
|
||||
loadButton->setFixedSize(QSize(24, 24));
|
||||
loadButton->setIcon(QIcon("Editor/UI/Icons/toolbar/libraryLoad.png"));
|
||||
loadButton->setIcon(QIcon("UI/Icons/toolbar/libraryLoad.png"));
|
||||
loadButton->setToolTip(tr("Load a saved filter"));
|
||||
loadButton->setProperty("iconButton", "true");
|
||||
|
||||
m_saveButton = new QPushButton(this);
|
||||
m_saveButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
|
||||
m_saveButton->setFixedSize(QSize(24, 24));
|
||||
m_saveButton->setIcon(QIcon("Editor/UI/Icons/toolbar/librarySave.png"));
|
||||
m_saveButton->setIcon(QIcon("UI/Icons/toolbar/librarySave.png"));
|
||||
m_saveButton->setToolTip(tr("Save the current filter"));
|
||||
m_saveButton->setEnabled(false);
|
||||
m_saveButton->setProperty("iconButton", "true");
|
||||
@@ -248,7 +248,7 @@ namespace AzToolsFramework
|
||||
m_toggleAllFiltersButton = new QPushButton(this);
|
||||
m_toggleAllFiltersButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
|
||||
m_toggleAllFiltersButton->setFixedSize(QSize(24, 24));
|
||||
m_toggleAllFiltersButton->setIcon(QIcon("Editor/Icons/animation/filter_16.png"));
|
||||
m_toggleAllFiltersButton->setIcon(QIcon("Icons/animation/filter_16.png"));
|
||||
m_toggleAllFiltersButton->setVisible(false);
|
||||
m_toggleAllFiltersButton->setToolTip(tr("Toggle all filters on/off"));
|
||||
m_toggleAllFiltersButton->setProperty("iconButton", "true");
|
||||
@@ -267,7 +267,7 @@ namespace AzToolsFramework
|
||||
m_clearAllButton = new QPushButton(this);
|
||||
m_clearAllButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
|
||||
m_clearAllButton->setFixedSize(QSize(24, 24));
|
||||
m_clearAllButton->setIcon(QIcon("Editor/Icons/animation/close.png"));
|
||||
m_clearAllButton->setIcon(QIcon("Icons/animation/close.png"));
|
||||
m_clearAllButton->setVisible(false);
|
||||
m_clearAllButton->setToolTip(tr("Clear all filters"));
|
||||
m_clearAllButton->setProperty("iconButton", "true");
|
||||
@@ -714,4 +714,4 @@ namespace AzToolsFramework
|
||||
|
||||
} // namespace AzToolsFramework
|
||||
|
||||
#include "UI/SearchWidget/moc_SearchCriteriaWidget.cpp"
|
||||
#include "UI/SearchWidget/moc_SearchCriteriaWidget.cpp"
|
||||
|
||||
+1
-1
@@ -151,4 +151,4 @@ Q_SIGNALS:
|
||||
};
|
||||
|
||||
using FilterByCategoryMap = AZStd::unordered_map<AZStd::string, QRegExp>;
|
||||
} // namespace AzToolsFramework
|
||||
} // namespace AzToolsFramework
|
||||
|
||||
+1
-1
@@ -18,4 +18,4 @@ namespace AzToolsFramework
|
||||
And,
|
||||
Or
|
||||
};
|
||||
} // namespace AzToolsFramework
|
||||
} // namespace AzToolsFramework
|
||||
|
||||
@@ -27,4 +27,4 @@ namespace AzToolsFramework
|
||||
};
|
||||
|
||||
using SliceRelationshipRequestBus = AZ::EBus<SliceRelationshipRequests>;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -42,4 +42,4 @@ namespace AzToolsFramework
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -49,4 +49,4 @@ namespace AzToolsFramework
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -42,4 +42,4 @@ namespace AzToolsFramework
|
||||
};
|
||||
} // namespace AzToolsFramework
|
||||
|
||||
#endif //COLOR_PICKER_DELEGATE_HXX
|
||||
#endif //COLOR_PICKER_DELEGATE_HXX
|
||||
|
||||
@@ -56,4 +56,4 @@ namespace AzToolsFramework
|
||||
|
||||
bool m_mouseOver;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,4 +52,4 @@ namespace AzToolsFramework
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -152,4 +152,4 @@ namespace AzToolsFramework
|
||||
virtual void ApplySnapshot(QTreeView* treeView) = 0;
|
||||
};
|
||||
|
||||
} //namespace AzToolsFramework
|
||||
} //namespace AzToolsFramework
|
||||
|
||||
@@ -46,4 +46,4 @@ namespace AzToolsFramework
|
||||
->Field("m_windowGeometry", &QWidgetSavedState::m_windowGeometry);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,4 +44,4 @@ namespace AzToolsFramework
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user