gui: Have listbook icons on left for all platforms

On Windows, this fixes the minimise/restore weird dialog bug on the
Emulation Settings and Plugin/BIOS selector dialogs. It also fixes a bug
at high DPI, where it becomes difficult to click on GUI elements at the
top of the dialog.

It also makes it easier for me to work on the Windows DPI stuff, I don't
have a 4k monitor.
This commit is contained in:
Jonathan Li 2015-09-05 21:49:34 +01:00
parent d87b34ab36
commit 5e9ba64db8
4 changed files with 3 additions and 43 deletions

View File

@ -37,12 +37,9 @@ DEFINE_EVENT_TYPE( pxEvt_SomethingChanged )
using namespace Panels;
// configure the orientation of the listbox based on the platform
// For now, they're all on the left.
static const int s_orient = wxLB_LEFT;
#if defined(__WXMAC__) || defined(__WXMSW__)
static const int s_orient = wxBK_TOP;
#else
static const int s_orient = wxBK_LEFT;
#endif
class ScopedOkButtonDisabler
{
@ -315,9 +312,3 @@ void Dialogs::BaseConfigurationDialog::OnScreenshot_Click( wxCommandEvent& evt )
#endif
}
}
void Dialogs::BaseConfigurationDialog::OnSettingsApplied( wxCommandEvent& evt )
{
evt.Skip();
MSW_ListView_SetIconSpacing( m_listbook, GetClientSize().GetWidth() );
}

View File

@ -70,8 +70,6 @@ namespace Dialogs
}
protected:
void OnSettingsApplied( wxCommandEvent& evt );
void OnOk_Click( wxCommandEvent& evt );
void OnCancel_Click( wxCommandEvent& evt );
void OnApply_Click( wxCommandEvent& evt );

View File

@ -14,15 +14,11 @@
*/
#include "PrecompiledHeader.h"
#include "GSFrame.h"
#include "MSWstuff.h"
#include <wx/listbook.h>
#include <wx/listctrl.h>
#ifdef __WXMSW__
# include <wx/msw/wrapwin.h> // needed for OutputDebugString
# include <commctrl.h>
#endif
void MSW_SetWindowAfter( WXWidget hwnd, WXWidget hwndAfter )
@ -32,28 +28,6 @@ void MSW_SetWindowAfter( WXWidget hwnd, WXWidget hwndAfter )
#endif
}
void MSW_ListView_SetIconSpacing( wxListbook& listbook, int width )
{
#ifdef __WXMSW__
// Depending on Windows version and user appearance settings, the default icon spacing can be
// way over generous. This little bit of Win32-specific code ensures proper icon spacing, scaled
// to the size of the frame's ideal width.
if (listbook.GetPageCount())
{
ListView_SetIconSpacing( (HWND)listbook.GetListView()->GetHWND(),
(width / listbook.GetPageCount()) - 4, g_Conf->Listbook_ImageSize+32 // y component appears to be ignored
);
}
#endif
}
void MSW_ListView_SetIconSpacing( wxListbook* listbook, int width )
{
if( listbook == NULL ) return;
MSW_ListView_SetIconSpacing( *listbook, width );
}
float MSW_GetDPIScale()
{
#ifdef __WXMSW__

View File

@ -15,12 +15,9 @@
#pragma once
class wxListbook;
// FIXME: Missing some includes.
extern void MSW_SetWindowAfter( WXWidget hwnd, WXWidget hwndAfter );
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 float MSW_GetDPIScale();
extern void pxDwm_Load();