43244d30e1
* Fix engine API change and add gem dependencies Signed-off-by: AMZN-alexpete <26804013+AMZN-alexpete@users.noreply.github.com> * Add GemCatalog dependency test Signed-off-by: AMZN-alexpete <26804013+AMZN-alexpete@users.noreply.github.com> * Clarify display name and fix missing const Signed-off-by: AMZN-alexpete <26804013+AMZN-alexpete@users.noreply.github.com> * Moving a couple helper functions into private scope Signed-off-by: AMZN-alexpete <26804013+AMZN-alexpete@users.noreply.github.com> * Update gem count when unselecting a gem #4074 This addresses the following issue https://github.com/o3de/o3de/issues/4074 Signed-off-by: AMZN-alexpete <26804013+AMZN-alexpete@users.noreply.github.com> * Active/Inactive filter and dependency tooltips Signed-off-by: AMZN-alexpete <26804013+AMZN-alexpete@users.noreply.github.com> * Accessors for previously added and dependencies Signed-off-by: AMZN-alexpete <26804013+AMZN-alexpete@users.noreply.github.com> * Cart displays gem dependency changes Signed-off-by: AMZN-alexpete <26804013+AMZN-alexpete@users.noreply.github.com> * Shorten titles to fit in summary popup Signed-off-by: AMZN-alexpete <26804013+AMZN-alexpete@users.noreply.github.com> * Remove QString::number Signed-off-by: AMZN-alexpete <26804013+AMZN-alexpete@users.noreply.github.com> * Remove extra space Signed-off-by: AMZN-alexpete <26804013+AMZN-alexpete@users.noreply.github.com> * Consolidate source model accesor helpers Signed-off-by: AMZN-alexpete <26804013+AMZN-alexpete@users.noreply.github.com> * Addressing minor feedback Signed-off-by: AMZN-alexpete <26804013+AMZN-alexpete@users.noreply.github.com> * Remove unused local variable Signed-off-by: AMZN-alexpete <26804013+AMZN-alexpete@users.noreply.github.com>
88 lines
2.4 KiB
C++
88 lines
2.4 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
|
|
*
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <AzCore/std/function/function_fwd.h>
|
|
|
|
#if !defined(Q_MOC_RUN)
|
|
#include <AzQtComponents/Components/SearchLineEdit.h>
|
|
#include <GemCatalog/GemModel.h>
|
|
#include <GemCatalog/GemSortFilterProxyModel.h>
|
|
#include <TagWidget.h>
|
|
#include <QFrame>
|
|
#include <QLabel>
|
|
#include <QDialog>
|
|
#include <QMoveEvent>
|
|
#include <QHideEvent>
|
|
#include <QVBoxLayout>
|
|
#endif
|
|
|
|
namespace O3DE::ProjectManager
|
|
{
|
|
class CartOverlayWidget
|
|
: public QWidget
|
|
{
|
|
Q_OBJECT // AUTOMOC
|
|
|
|
public:
|
|
CartOverlayWidget(GemModel* gemModel, QWidget* parent = nullptr);
|
|
|
|
private:
|
|
QStringList ConvertFromModelIndices(const QVector<QModelIndex>& gems) const;
|
|
|
|
using GetTagIndicesCallback = AZStd::function<QVector<QModelIndex>()>;
|
|
void CreateGemSection(const QString& singularTitle, const QString& pluralTitle, GetTagIndicesCallback getTagIndices);
|
|
|
|
QVBoxLayout* m_layout = nullptr;
|
|
GemModel* m_gemModel = nullptr;
|
|
|
|
inline constexpr static int s_width = 240;
|
|
};
|
|
|
|
class CartButton
|
|
: public QWidget
|
|
{
|
|
Q_OBJECT // AUTOMOC
|
|
|
|
public:
|
|
CartButton(GemModel* gemModel, QWidget* parent = nullptr);
|
|
~CartButton();
|
|
void ShowOverlay();
|
|
|
|
private:
|
|
void mousePressEvent(QMouseEvent* event) override;
|
|
void hideEvent(QHideEvent*) override;
|
|
|
|
GemModel* m_gemModel = nullptr;
|
|
QHBoxLayout* m_layout = nullptr;
|
|
QLabel* m_countLabel = nullptr;
|
|
QPushButton* m_dropDownButton = nullptr;
|
|
CartOverlayWidget* m_cartOverlay = nullptr;
|
|
|
|
inline constexpr static int s_iconSize = 24;
|
|
inline constexpr static int s_arrowDownIconSize = 8;
|
|
};
|
|
|
|
class GemCatalogHeaderWidget
|
|
: public QFrame
|
|
{
|
|
Q_OBJECT // AUTOMOC
|
|
|
|
public:
|
|
explicit GemCatalogHeaderWidget(GemModel* gemModel, GemSortFilterProxyModel* filterProxyModel, QWidget* parent = nullptr);
|
|
~GemCatalogHeaderWidget() = default;
|
|
|
|
void ReinitForProject();
|
|
|
|
private:
|
|
AzQtComponents::SearchLineEdit* m_filterLineEdit = nullptr;
|
|
inline constexpr static int s_height = 60;
|
|
};
|
|
} // namespace O3DE::ProjectManager
|