Files
o3de/Gems/LyShine/Code/Editor/ComponentButton.cpp
T
Steve Pham 38261d0800 Shorten copyright headers by splitting into 2 lines (#2213)
* Updated all copyright headers to split the longer original copyright line into 2 shorter lines

Signed-off-by: Steve Pham <spham@amazon.com>
2021-07-16 15:25:48 -07:00

41 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 "UiCanvasEditor_precompiled.h"
#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>