PerScreenDpi | QLabels incorrectly handle scale for icons (#4070)
* Fixes to icon generation. Generating a pixmap out of a size won't take the screen scaling factor into account, resulting in blurry results. Note that this is not a catchall solution, every case needs to be addressed manually. Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com> * HighDpi fixes for startup splashscreen and About dialog Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com> * Add helper function to generate appropriate pixmaps for a screen based on its dpi settings. Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
// AzCore
|
||||
#include <AzCore/Casting/numeric_cast.h> // for aznumeric_cast
|
||||
|
||||
#include <AzQtComponents/Utilities/PixmapScaleUtilities.h>
|
||||
|
||||
AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING
|
||||
#include <ui_AboutDialog.h>
|
||||
@@ -46,8 +47,13 @@ CAboutDialog::CAboutDialog(QString versionText, QString richTextCopyrightNotice,
|
||||
CAboutDialog > QLabel#link { text-decoration: underline; color: #94D2FF; }");
|
||||
|
||||
// Prepare background image
|
||||
QImage backgroundImage(QStringLiteral(":/StartupLogoDialog/splashscreen_background_developer_preview.jpg"));
|
||||
m_backgroundImage = QPixmap::fromImage(backgroundImage.scaled(m_enforcedWidth, m_enforcedHeight, Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
|
||||
m_backgroundImage = AzQtComponents::ScalePixmapForScreenDpi(
|
||||
QPixmap(QStringLiteral(":/StartupLogoDialog/splashscreen_background_developer_preview.jpg")),
|
||||
screen(),
|
||||
QSize(m_enforcedWidth, m_enforcedHeight),
|
||||
Qt::IgnoreAspectRatio,
|
||||
Qt::SmoothTransformation
|
||||
);
|
||||
|
||||
// Draw the Open 3D Engine logo from svg
|
||||
m_ui->m_logo->load(QStringLiteral(":/StartupLogoDialog/o3de_logo.svg"));
|
||||
|
||||
Reference in New Issue
Block a user