From 580027f75e919b3e45347f3f895c994d501af77a Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Tue, 16 Nov 2021 16:36:59 -0800 Subject: [PATCH] Removes ComponentPaletteWindow from Code/Editor/Plugins/ComponentEntityEditorPlugin Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../ComponentEntityEditorPlugin.cpp | 1 - .../ComponentPaletteWindow.cpp | 116 ------------------ .../ComponentPalette/ComponentPaletteWindow.h | 59 --------- .../componententityeditorplugin_files.cmake | 2 - 4 files changed, 178 deletions(-) delete mode 100644 Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/ComponentPaletteWindow.cpp delete mode 100644 Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/ComponentPaletteWindow.h diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/ComponentEntityEditorPlugin.cpp b/Code/Editor/Plugins/ComponentEntityEditorPlugin/ComponentEntityEditorPlugin.cpp index 50b315b9c3..9022341309 100644 --- a/Code/Editor/Plugins/ComponentEntityEditorPlugin/ComponentEntityEditorPlugin.cpp +++ b/Code/Editor/Plugins/ComponentEntityEditorPlugin/ComponentEntityEditorPlugin.cpp @@ -14,7 +14,6 @@ #include "UI/QComponentEntityEditorOutlinerWindow.h" #include "UI/QComponentLevelEntityEditorMainWindow.h" #include "UI/ComponentPalette/ComponentPaletteSettings.h" -#include "UI/ComponentPalette/ComponentPaletteWindow.h" #include #include diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/ComponentPaletteWindow.cpp b/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/ComponentPaletteWindow.cpp deleted file mode 100644 index 1791301654..0000000000 --- a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/ComponentPaletteWindow.cpp +++ /dev/null @@ -1,116 +0,0 @@ -/* - * 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 - * - */ - -#include "ComponentPaletteWindow.h" -#include "ComponentDataModel.h" -#include "FavoriteComponentList.h" -#include "FilteredComponentList.h" -#include "CategoriesList.h" - -#include - -#include -#include -#include - -#include -#include -#include -#include -#include - -#include -#include - -ComponentPaletteWindow::ComponentPaletteWindow(QWidget* parent) - : QMainWindow(parent) -{ - Init(); -} - -void ComponentPaletteWindow::Init() -{ - layout()->setSizeConstraint(QLayout::SetMinimumSize); - - QVBoxLayout* layout = new QVBoxLayout(); - layout->setSizeConstraint(QLayout::SetMinimumSize); - layout->setContentsMargins(0, 0, 0, 0); - layout->setSpacing(0); - - QHBoxLayout* gridLayout = new QHBoxLayout(nullptr); - gridLayout->setSizeConstraint(QLayout::SetMaximumSize); - gridLayout->setContentsMargins(0, 0, 0, 0); - gridLayout->setSpacing(0); - - m_filterWidget = new AzToolsFramework::SearchCriteriaWidget(this); - - QStringList tags; - tags << tr("name"); - m_filterWidget->SetAcceptedTags(tags, tags[0]); - layout->addLayout(gridLayout, 1); - - // Left Panel - QVBoxLayout* leftPaneLayout = new QVBoxLayout(this); - - // Favorites - leftPaneLayout->addWidget(new QLabel(tr("Favorites"))); - leftPaneLayout->addWidget(new QLabel(tr("Drag components here to add favorites."))); - FavoritesList* favorites = new FavoritesList(); - favorites->Init(); - leftPaneLayout->addWidget(favorites); - - // Categories - m_categoryListWidget = new ComponentCategoryList(); - m_categoryListWidget->Init(); - leftPaneLayout->addWidget(m_categoryListWidget); - gridLayout->addLayout(leftPaneLayout); - - // Right Panel - QVBoxLayout* rightPanelLayout = new QVBoxLayout(this); - gridLayout->addLayout(rightPanelLayout); - - // Component list - m_componentListWidget = new FilteredComponentList(this); - m_componentListWidget->Init(); - - rightPanelLayout->addWidget(new QLabel(tr("Components"))); - rightPanelLayout->addWidget(m_filterWidget, 0, Qt::AlignTop); - rightPanelLayout->addWidget(m_componentListWidget); - - // The main window - QWidget* window = new QWidget(); - window->setLayout(layout); - setCentralWidget(window); - - connect(m_categoryListWidget, &ComponentCategoryList::OnCategoryChange, m_componentListWidget, &FilteredComponentList::SetCategory); - connect(m_filterWidget, &AzToolsFramework::SearchCriteriaWidget::SearchCriteriaChanged, m_componentListWidget, &FilteredComponentList::SearchCriteriaChanged); - -} - -void ComponentPaletteWindow::keyPressEvent(QKeyEvent* event) -{ - if (event->modifiers().testFlag(Qt::ControlModifier) && event->key() == Qt::Key_F) - { - m_filterWidget->SelectTextEntryBox(); - } - else - { - QMainWindow::keyPressEvent(event); - } -} - -void ComponentPaletteWindow::RegisterViewClass() -{ - using namespace AzToolsFramework; - - ViewPaneOptions options; - options.canHaveMultipleInstances = true; - RegisterViewPane("Component Palette", LyViewPane::CategoryOther, options); -} - -#include diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/ComponentPaletteWindow.h b/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/ComponentPaletteWindow.h deleted file mode 100644 index f662f69342..0000000000 --- a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/ComponentPaletteWindow.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * 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 - -#if !defined(Q_MOC_RUN) -#include -#include -#include -#endif - -namespace AzToolsFramework -{ - class SearchCriteriaWidget; -} - -class ComponentCategoryList; -class FilteredComponentList; -class ComponentDataModel; - -//! ComponentPaletteWindow -//! Provides a window with controls related to the Component Entity system. It provides an intuitive and organized -//! set of controls to display, sort, filter components. It provides mechanisms for creating entities by dragging -//! and dropping components into the viewport as well as from context menus. -class ComponentPaletteWindow - : public QMainWindow -{ - Q_OBJECT - -public: - - explicit ComponentPaletteWindow(QWidget* parent = 0); - - void Init(); - - static const GUID& GetClassID() - { - // {4236998F-1138-466D-9DF5-6533BFA1DFCA} - static const GUID guid = - { - 0x4236998F, 0x1138, 0x466D, { 0x9D, 0xF5, 0x65, 0x33, 0xBF, 0xA1, 0xDF, 0xCA } - }; - return guid; - } - - static void RegisterViewClass(); - -protected: - ComponentCategoryList* m_categoryListWidget; - FilteredComponentList* m_componentListWidget; - AzToolsFramework::SearchCriteriaWidget* m_filterWidget; - - void keyPressEvent(QKeyEvent* event) override; -}; diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/componententityeditorplugin_files.cmake b/Code/Editor/Plugins/ComponentEntityEditorPlugin/componententityeditorplugin_files.cmake index 1cb4e25304..a03c25e8f0 100644 --- a/Code/Editor/Plugins/ComponentEntityEditorPlugin/componententityeditorplugin_files.cmake +++ b/Code/Editor/Plugins/ComponentEntityEditorPlugin/componententityeditorplugin_files.cmake @@ -25,8 +25,6 @@ set(FILES UI/ComponentPalette/ComponentDataModel.h UI/ComponentPalette/ComponentDataModel.cpp UI/ComponentPalette/ComponentPaletteSettings.h - UI/ComponentPalette/ComponentPaletteWindow.h - UI/ComponentPalette/ComponentPaletteWindow.cpp UI/ComponentPalette/FavoriteComponentList.h UI/ComponentPalette/FavoriteComponentList.cpp UI/ComponentPalette/FilteredComponentList.h