Merge pull request #1759 from aws-lumberyard-dev/jillich/prism/LYN-4437

[LYN-4437] Replaced the background images and added a semi-transparent overlay for the Project Manager

Signed-off-by: Benjamin Jillich <jillich@amazon.com>
main
Benjamin Jillich 5 years ago committed by GitHub
commit 4c3e27f3ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:342c3eaccf68a178dfd8c2b1792a93a8c9197c8184dca11bf90706d7481df087
size 1611268

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7088e902885d98953f6a1715efab319c063a4ab8918fd0e810251c8ed82b8514
size 542983

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:797794816e4b1702f1ae1f32b408c95c79eb1f8a95aba43cfad9cccc181b0bda
size 1135182

@ -26,12 +26,13 @@
<file>o3de.svg</file>
<file>menu.svg</file>
<file>menu_hover.svg</file>
<file>Backgrounds/FirstTimeBackgroundImage.jpg</file>
<file>ArrowDownLine.svg</file>
<file>ArrowUpLine.svg</file>
<file>CarrotArrowDown.svg</file>
<file>Summary.svg</file>
<file>WindowClose.svg</file>
<file>Warning.svg</file>
<file>Backgrounds/DefaultBackground.jpg</file>
<file>Backgrounds/FtueBackground.jpg</file>
</qresource>
</RCC>

@ -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<int>(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

Loading…
Cancel
Save