Files
o3de/Gems/LyShine/Code/Editor/ComponentButton.cpp
T
Esteban Papp 289f236cab Gems/LyShine
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
2021-07-13 16:42:51 -07:00

38 lines
1.1 KiB
C++

/*
* 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 "EditorCommon.h"
ComponentButton::ComponentButton(HierarchyWidget* hierarchy,
QWidget* parent)
: QPushButton(parent)
{
setText("Add Component...");
QObject::connect(this,
&QPushButton::clicked,
hierarchy,
[hierarchy]([[maybe_unused]] bool checked)
{
HierarchyMenu contextMenu(hierarchy,
HierarchyMenu::Show::kAddComponents,
true);
contextMenu.exec(QCursor::pos());
});
QObject::connect(hierarchy,
SIGNAL(SetUserSelection(HierarchyItemRawPtrList*)),
SLOT(UserSelectionChanged(HierarchyItemRawPtrList*)));
}
void ComponentButton::UserSelectionChanged([[maybe_unused]] HierarchyItemRawPtrList* items)
{
// no longer need to enable/disable because we always show the button, if nothing is selected it adds to the canvas entity
}
#include <moc_ComponentButton.cpp>