mirror of https://github.com/PCSX2/pcsx2.git
gui:windows: Scale settings dialog widths with DPI
Height is calculated automatically, so that's sort of ok. A lot more fixes will be needed to fix the rest of the DPI stuff.
This commit is contained in:
parent
149b7fc347
commit
9929962d54
|
@ -135,7 +135,9 @@ void BaseApplicableDialog::OnSettingsApplied( wxCommandEvent& evt )
|
||||||
Dialogs::BaseConfigurationDialog::BaseConfigurationDialog( wxWindow* parent, const wxString& title, int idealWidth )
|
Dialogs::BaseConfigurationDialog::BaseConfigurationDialog( wxWindow* parent, const wxString& title, int idealWidth )
|
||||||
: _parent( parent, title )
|
: _parent( parent, title )
|
||||||
{
|
{
|
||||||
SetMinWidth( idealWidth );
|
float scale = MSW_GetDPIScale();
|
||||||
|
|
||||||
|
SetMinWidth( scale * idealWidth );
|
||||||
m_listbook = NULL;
|
m_listbook = NULL;
|
||||||
m_allowApplyActivation = true;
|
m_allowApplyActivation = true;
|
||||||
|
|
||||||
|
|
|
@ -54,3 +54,15 @@ void MSW_ListView_SetIconSpacing( wxListbook* listbook, int width )
|
||||||
MSW_ListView_SetIconSpacing( *listbook, width );
|
MSW_ListView_SetIconSpacing( *listbook, width );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
float MSW_GetDPIScale()
|
||||||
|
{
|
||||||
|
#ifdef __WXMSW__
|
||||||
|
HDC screen = GetDC(0);
|
||||||
|
float scale = GetDeviceCaps(screen, LOGPIXELSX) / 96.0;
|
||||||
|
ReleaseDC(NULL, screen);
|
||||||
|
|
||||||
|
return scale;
|
||||||
|
#else
|
||||||
|
return 1.0;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
|
@ -21,6 +21,7 @@ extern void MSW_SetWindowAfter( WXWidget hwnd, WXWidget hwndAfter );
|
||||||
extern void MSW_OutputDebugString( const wxString& text );
|
extern void MSW_OutputDebugString( const wxString& text );
|
||||||
extern void MSW_ListView_SetIconSpacing( wxListbook& listbook, int width );
|
extern void MSW_ListView_SetIconSpacing( wxListbook& listbook, int width );
|
||||||
extern void MSW_ListView_SetIconSpacing( wxListbook* listbook, int width );
|
extern void MSW_ListView_SetIconSpacing( wxListbook* listbook, int width );
|
||||||
|
extern float MSW_GetDPIScale();
|
||||||
|
|
||||||
extern void pxDwm_Load();
|
extern void pxDwm_Load();
|
||||||
extern void pxDwm_Unload();
|
extern void pxDwm_Unload();
|
||||||
|
|
Loading…
Reference in New Issue