From 363b87b3348c066b7902db18a9465674cef46b9d Mon Sep 17 00:00:00 2001 From: Jonathan Li Date: Mon, 25 Nov 2019 15:50:37 +0000 Subject: [PATCH] gui: Fix about dialog logo DPI scaling Also dynamically allocate the wxStaticBitmap control since its parent window will delete it, which can cause issues. --- pcsx2/gui/Dialogs/AboutBoxDialog.cpp | 12 +++++++----- pcsx2/gui/Dialogs/ModalPopups.h | 3 --- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/pcsx2/gui/Dialogs/AboutBoxDialog.cpp b/pcsx2/gui/Dialogs/AboutBoxDialog.cpp index 3d380be8f9..cff0b21bf8 100644 --- a/pcsx2/gui/Dialogs/AboutBoxDialog.cpp +++ b/pcsx2/gui/Dialogs/AboutBoxDialog.cpp @@ -34,13 +34,15 @@ using namespace pxSizerFlags; Dialogs::AboutBoxDialog::AboutBoxDialog(wxWindow* parent) : wxDialogWithHelpers(parent, AddAppName(_("About %s")), pxDialogFlags()) - , m_bitmap_logo(this, wxID_ANY, wxBitmap(EmbeddedImage().Get()), - wxDefaultPosition, wxDefaultSize) { - // Main layout - SetMinWidth(MSW_GetDPIScale() * 460); + const float scale = MSW_GetDPIScale(); + SetMinWidth(scale * 460); - *this += m_bitmap_logo | StdCenter(); + wxImage img = EmbeddedImage().Get(); + img.Rescale(img.GetWidth() * scale, img.GetHeight() * scale, wxIMAGE_QUALITY_HIGH); + auto bitmap_logo = new wxStaticBitmap(this, wxID_ANY, wxBitmap(img)); + + *this += bitmap_logo | StdCenter(); #ifdef _WIN32 const int padding = 15; diff --git a/pcsx2/gui/Dialogs/ModalPopups.h b/pcsx2/gui/Dialogs/ModalPopups.h index bf1d7fa775..27814bd491 100644 --- a/pcsx2/gui/Dialogs/ModalPopups.h +++ b/pcsx2/gui/Dialogs/ModalPopups.h @@ -60,9 +60,6 @@ namespace Dialogs { class AboutBoxDialog: public wxDialogWithHelpers { - protected: - wxStaticBitmap m_bitmap_logo; - public: AboutBoxDialog( wxWindow* parent=NULL ); virtual ~AboutBoxDialog() = default;