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:
Danilo Aimini
2021-09-14 12:35:56 -07:00
committed by GitHub
parent 73b04d7e34
commit c0426ba465
15 changed files with 94 additions and 31 deletions
@@ -34,6 +34,7 @@
// AzQtComponents
#include <AzQtComponents/Components/Widgets/CheckBox.h>
#include <AzQtComponents/Components/WindowDecorationWrapper.h>
#include <AzQtComponents/Utilities/PixmapScaleUtilities.h>
// Editor
#include "Settings.h"
@@ -79,8 +80,11 @@ WelcomeScreenDialog::WelcomeScreenDialog(QWidget* pParent)
{
projectPreviewPath = ":/WelcomeScreenDialog/DefaultProjectImage.png";
}
ui->activeProjectIcon->setPixmap(
QPixmap(projectPreviewPath).scaled(
AzQtComponents::ScalePixmapForScreenDpi(
QPixmap(projectPreviewPath),
screen(),
ui->activeProjectIcon->size(),
Qt::KeepAspectRatioByExpanding,
Qt::SmoothTransformation