gui:windows: Scale confirmation dialogs at high DPI

This should scale all the other dialogs that don't have specifics widths
set.
This commit is contained in:
Jonathan Li 2015-10-05 16:45:35 +01:00
parent 31b1e34ae8
commit 5f2e60d751
2 changed files with 4 additions and 2 deletions

View File

@ -16,6 +16,7 @@
#include "PrecompiledHeader.h"
#include "System.h"
#include "App.h"
#include "MSWstuff.h"
#include "ModalPopups.h"
#include "Utilities/StringHelpers.h"
@ -143,7 +144,7 @@ void MsgButtons::SetBestFocus( wxWindow* dialog ) const
wxWindowID pxIssueConfirmation( wxDialogWithHelpers& confirmDlg, const MsgButtons& buttons )
{
if( confirmDlg.GetMinWidth() <= 0 ) confirmDlg.SetMinWidth( 400 );
if( confirmDlg.GetMinWidth() <= 0 ) confirmDlg.SetMinWidth( 400 * MSW_GetDPIScale());
confirmDlg += new ModalButtonPanel( &confirmDlg, buttons ) | pxCenter.Border( wxTOP, 8 );
buttons.SetBestFocus( confirmDlg );

View File

@ -15,6 +15,7 @@
#include "PrecompiledHeader.h"
#include "App.h"
#include "MSWstuff.h"
#include "Dialogs/ModalPopups.h"
using namespace Threading;
@ -36,7 +37,7 @@ static int pxMessageDialog( const wxString& caption, const wxString& content, co
// And in either case the emulation should be paused/suspended for the user.
wxDialogWithHelpers dialog( NULL, caption );
dialog.SetMinWidth( (content.Length() > 256) ? 525 : 460 );
dialog.SetMinWidth( ((content.Length() > 256) ? 525 : 460) * MSW_GetDPIScale() );
dialog += dialog.Heading( content ) | StdExpand();
return pxIssueConfirmation( dialog, buttons );
}