diff --git a/Code/Tools/ProjectManager/Resources/Backgrounds/DefaultBackground.jpg b/Code/Tools/ProjectManager/Resources/Backgrounds/DefaultBackground.jpg new file mode 100644 index 0000000000..3af15393c4 --- /dev/null +++ b/Code/Tools/ProjectManager/Resources/Backgrounds/DefaultBackground.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:342c3eaccf68a178dfd8c2b1792a93a8c9197c8184dca11bf90706d7481df087 +size 1611268 diff --git a/Code/Tools/ProjectManager/Resources/Backgrounds/FirstTimeBackgroundImage.jpg b/Code/Tools/ProjectManager/Resources/Backgrounds/FirstTimeBackgroundImage.jpg deleted file mode 100644 index bfa5f83cf6..0000000000 --- a/Code/Tools/ProjectManager/Resources/Backgrounds/FirstTimeBackgroundImage.jpg +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:7088e902885d98953f6a1715efab319c063a4ab8918fd0e810251c8ed82b8514 -size 542983 diff --git a/Code/Tools/ProjectManager/Resources/Backgrounds/FtueBackground.jpg b/Code/Tools/ProjectManager/Resources/Backgrounds/FtueBackground.jpg new file mode 100644 index 0000000000..44291a8b1d --- /dev/null +++ b/Code/Tools/ProjectManager/Resources/Backgrounds/FtueBackground.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:797794816e4b1702f1ae1f32b408c95c79eb1f8a95aba43cfad9cccc181b0bda +size 1135182 diff --git a/Code/Tools/ProjectManager/Resources/ProjectManager.qrc b/Code/Tools/ProjectManager/Resources/ProjectManager.qrc index 0b9de2af89..cfe4b37fbc 100644 --- a/Code/Tools/ProjectManager/Resources/ProjectManager.qrc +++ b/Code/Tools/ProjectManager/Resources/ProjectManager.qrc @@ -26,12 +26,13 @@ o3de.svg menu.svg menu_hover.svg - Backgrounds/FirstTimeBackgroundImage.jpg ArrowDownLine.svg ArrowUpLine.svg CarrotArrowDown.svg Summary.svg WindowClose.svg Warning.svg + Backgrounds/DefaultBackground.jpg + Backgrounds/FtueBackground.jpg diff --git a/Code/Tools/ProjectManager/Source/ProjectsScreen.cpp b/Code/Tools/ProjectManager/Source/ProjectsScreen.cpp index cc3e386118..b3ecd96e43 100644 --- a/Code/Tools/ProjectManager/Source/ProjectsScreen.cpp +++ b/Code/Tools/ProjectManager/Source/ProjectsScreen.cpp @@ -53,8 +53,6 @@ namespace O3DE::ProjectManager vLayout->setContentsMargins(s_contentMargins, 0, s_contentMargins, 0); setLayout(vLayout); - m_background.load(":/Backgrounds/FirstTimeBackgroundImage.jpg"); - m_stack = new QStackedWidget(this); m_firstTimeContent = CreateFirstTimeContent(); @@ -232,6 +230,8 @@ namespace O3DE::ProjectManager m_projectsContent->deleteLater(); } + m_background.load(":/Backgrounds/DefaultBackground.jpg"); + // Make sure to update builder with latest Project Button if (m_currentBuilder) { @@ -269,21 +269,30 @@ namespace O3DE::ProjectManager // we paint the background here because qss does not support background cover scaling QPainter painter(this); - auto winSize = size(); - auto pixmapRatio = (float)m_background.width() / m_background.height(); - auto windowRatio = (float)winSize.width() / winSize.height(); + const QSize winSize = size(); + const float pixmapRatio = (float)m_background.width() / m_background.height(); + const float windowRatio = (float)winSize.width() / winSize.height(); + QRect backgroundRect; if (pixmapRatio > windowRatio) { - auto newWidth = (int)(winSize.height() * pixmapRatio); - auto offset = (newWidth - winSize.width()) / -2; - painter.drawPixmap(offset, 0, newWidth, winSize.height(), m_background); + const int newWidth = (int)(winSize.height() * pixmapRatio); + const int offset = (newWidth - winSize.width()) / -2; + backgroundRect = QRect(offset, 0, newWidth, winSize.height()); } else { - auto newHeight = (int)(winSize.width() / pixmapRatio); - painter.drawPixmap(0, 0, winSize.width(), newHeight, m_background); + const int newHeight = (int)(winSize.width() / pixmapRatio); + backgroundRect = QRect(0, 0, winSize.width(), newHeight); } + + // Draw the background image. + painter.drawPixmap(backgroundRect, m_background); + + // Draw a semi-transparent overlay to darken down the colors. + painter.setCompositionMode (QPainter::CompositionMode_DestinationIn); + const float overlayTransparency = 0.7f; + painter.fillRect(backgroundRect, QColor(0, 0, 0, static_cast(255.0f * overlayTransparency))); } void ProjectsScreen::HandleNewProjectButton() @@ -459,6 +468,7 @@ namespace O3DE::ProjectManager { if (ShouldDisplayFirstTimeContent()) { + m_background.load(":/Backgrounds/FtueBackground.jpg"); m_stack->setCurrentWidget(m_firstTimeContent); } else