Skip to content
Permalink
Browse files

gui: Fix about dialog logo DPI scaling

Also dynamically allocate the wxStaticBitmap control since its parent
window will delete it, which can cause issues.
  • Loading branch information
turtleli authored and lightningterror committed Nov 25, 2019
1 parent 1dc5d07 commit 363b87b3348c066b7902db18a9465674cef46b9d
Showing with 7 additions and 8 deletions.
  1. +7 −5 pcsx2/gui/Dialogs/AboutBoxDialog.cpp
  2. +0 −3 pcsx2/gui/Dialogs/ModalPopups.h
@@ -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<res_Logo>().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<res_Logo>().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;
@@ -60,9 +60,6 @@ namespace Dialogs
{
class AboutBoxDialog: public wxDialogWithHelpers
{
protected:
wxStaticBitmap m_bitmap_logo;

public:
AboutBoxDialog( wxWindow* parent=NULL );
virtual ~AboutBoxDialog() = default;

0 comments on commit 363b87b

Please sign in to comment.
You can’t perform that action at this time.