Project Manager: Added Per Project Template Previews and Icon Overlays (#1994)
* Project Manager: Added Per Project Template Previews and Icon Overlays Signed-off-by: nggieber <nggieber@amazon.com> * Remove template icon overlays and bake them into template preview Signed-off-by: nggieber <nggieber@amazon.com> * Remove unused variables and headers Signed-off-by: nggieber <nggieber@amazon.com>
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
*/
|
||||
|
||||
#include <NewProjectSettingsScreen.h>
|
||||
#include <ProjectManagerDefs.h>
|
||||
#include <PythonBindingsInterface.h>
|
||||
#include <FormBrowseEditWidget.h>
|
||||
#include <FormLineEditWidget.h>
|
||||
@@ -117,7 +118,7 @@ namespace O3DE::ProjectManager
|
||||
for (int index = 0; index < m_templates.size(); ++index)
|
||||
{
|
||||
ProjectTemplateInfo projectTemplate = m_templates.at(index);
|
||||
QString projectPreviewPath = projectTemplate.m_path + "/Template/preview.png";
|
||||
QString projectPreviewPath = QDir(projectTemplate.m_path).filePath(ProjectPreviewImagePath);
|
||||
QFileInfo doesPreviewExist(projectPreviewPath);
|
||||
if (!doesPreviewExist.exists() || !doesPreviewExist.isFile())
|
||||
{
|
||||
|
||||
@@ -12,6 +12,7 @@ namespace O3DE::ProjectManager
|
||||
{
|
||||
inline constexpr static int ProjectPreviewImageWidth = 210;
|
||||
inline constexpr static int ProjectPreviewImageHeight = 280;
|
||||
inline constexpr static int ProjectTemplateImageWidth = 92;
|
||||
|
||||
static const QString ProjectBuildPathPostfix = "build/windows_vs2019";
|
||||
static const QString ProjectBuildPathCmakeFiles = "CMakeFiles";
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
*/
|
||||
|
||||
#include <TemplateButtonWidget.h>
|
||||
#include <ProjectManagerDefs.h>
|
||||
|
||||
#include <QVBoxLayout>
|
||||
#include <QLabel>
|
||||
@@ -16,7 +17,6 @@
|
||||
|
||||
namespace O3DE::ProjectManager
|
||||
{
|
||||
|
||||
TemplateButton::TemplateButton(const QString& imagePath, const QString& labelText, QWidget* parent)
|
||||
: QPushButton(parent)
|
||||
{
|
||||
@@ -31,8 +31,8 @@ namespace O3DE::ProjectManager
|
||||
|
||||
QLabel* image = new QLabel(this);
|
||||
image->setObjectName("templateImage");
|
||||
image->setPixmap(
|
||||
QPixmap(imagePath).scaled(QSize(s_templateImageWidth,s_templateImageHeight) , Qt::KeepAspectRatio, Qt::SmoothTransformation));
|
||||
image->setPixmap(QPixmap(imagePath).scaled(
|
||||
QSize(ProjectTemplateImageWidth, ProjectTemplateImageWidth), Qt::KeepAspectRatio, Qt::SmoothTransformation));
|
||||
vLayout->addWidget(image);
|
||||
|
||||
QLabel* label = new QLabel(labelText, this);
|
||||
|
||||
@@ -24,9 +24,5 @@ namespace O3DE::ProjectManager
|
||||
|
||||
protected slots:
|
||||
void onToggled();
|
||||
|
||||
private:
|
||||
inline constexpr static int s_templateImageWidth = 92;
|
||||
inline constexpr static int s_templateImageHeight = 122;
|
||||
};
|
||||
} // namespace O3DE::ProjectManager
|
||||
|
||||
Reference in New Issue
Block a user