LYN-4920 | The project image on the welcome page is disconnected from the Project manager (#1738)

* Display the correct project preview image in the Editor's Welcome Dialog.

Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>

* Minor fixes to variable naming for clarity.

Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
This commit is contained in:
Danilo Aimini
2021-07-01 20:55:29 -07:00
committed by GitHub
parent 6a0b8ae6b6
commit a0a36b867f
5 changed files with 20 additions and 8 deletions
@@ -75,6 +75,21 @@ WelcomeScreenDialog::WelcomeScreenDialog(QWidget* pParent)
{
ui->setupUi(this);
// Set the project preview image
QString projectPreviewPath = QDir(AZ::Utils::GetProjectPath().c_str()).filePath("preview.png");
QFileInfo projectPreviewPathInfo(projectPreviewPath);
if (!projectPreviewPathInfo.exists() || !projectPreviewPathInfo.isFile())
{
projectPreviewPath = ":/WelcomeScreenDialog/DefaultProjectImage.png";
}
ui->activeProjectIcon->setPixmap(
QPixmap(projectPreviewPath).scaled(
ui->activeProjectIcon->size(),
Qt::KeepAspectRatioByExpanding,
Qt::SmoothTransformation
)
);
ui->recentLevelTable->setColumnCount(3);
ui->recentLevelTable->setMouseTracking(true);
ui->recentLevelTable->setContextMenuPolicy(Qt::CustomContextMenu);