From 5e9ba64db8207c06cc8c2c2fbe1fcc1d511693eb Mon Sep 17 00:00:00 2001 From: Jonathan Li Date: Sat, 5 Sep 2015 21:49:34 +0100 Subject: [PATCH 1/2] 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. --- pcsx2/gui/Dialogs/BaseConfigurationDialog.cpp | 13 ++-------- pcsx2/gui/Dialogs/ConfigurationDialog.h | 2 -- pcsx2/gui/MSWstuff.cpp | 26 ------------------- pcsx2/gui/MSWstuff.h | 5 +--- 4 files changed, 3 insertions(+), 43 deletions(-) diff --git a/pcsx2/gui/Dialogs/BaseConfigurationDialog.cpp b/pcsx2/gui/Dialogs/BaseConfigurationDialog.cpp index d0c00c8d5..96b3e336e 100644 --- a/pcsx2/gui/Dialogs/BaseConfigurationDialog.cpp +++ b/pcsx2/gui/Dialogs/BaseConfigurationDialog.cpp @@ -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() ); -} diff --git a/pcsx2/gui/Dialogs/ConfigurationDialog.h b/pcsx2/gui/Dialogs/ConfigurationDialog.h index 25de2698a..478733ce2 100644 --- a/pcsx2/gui/Dialogs/ConfigurationDialog.h +++ b/pcsx2/gui/Dialogs/ConfigurationDialog.h @@ -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 ); diff --git a/pcsx2/gui/MSWstuff.cpp b/pcsx2/gui/MSWstuff.cpp index 84295e12d..2ac3fca86 100644 --- a/pcsx2/gui/MSWstuff.cpp +++ b/pcsx2/gui/MSWstuff.cpp @@ -14,15 +14,11 @@ */ #include "PrecompiledHeader.h" -#include "GSFrame.h" #include "MSWstuff.h" -#include -#include #ifdef __WXMSW__ # include // needed for OutputDebugString -# include #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__ diff --git a/pcsx2/gui/MSWstuff.h b/pcsx2/gui/MSWstuff.h index e40e2e3a7..063c7dd90 100644 --- a/pcsx2/gui/MSWstuff.h +++ b/pcsx2/gui/MSWstuff.h @@ -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(); From 1d2d8cd38bb2a759c2153738ba9b73589a994055 Mon Sep 17 00:00:00 2001 From: Jonathan Li Date: Sat, 5 Sep 2015 21:54:17 +0100 Subject: [PATCH 2/2] gui: Don't set min widths for Framelimiter/skip panels It causes weird behaviour at higher DPIs. --- pcsx2/gui/Panels/VideoPanel.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/pcsx2/gui/Panels/VideoPanel.cpp b/pcsx2/gui/Panels/VideoPanel.cpp index d9dd111b8..a6f6b55af 100644 --- a/pcsx2/gui/Panels/VideoPanel.cpp +++ b/pcsx2/gui/Panels/VideoPanel.cpp @@ -29,8 +29,6 @@ using namespace pxSizerFlags; Panels::FramelimiterPanel::FramelimiterPanel( wxWindow* parent ) : BaseApplicableConfigPanel_SpecificConfig( parent ) { - SetMinWidth( 280 ); - m_check_LimiterDisable = new pxCheckBox( this, _("Disable Framelimiting"), _("Useful for running benchmarks. Toggle this option in-game by pressing F4.") ); @@ -169,8 +167,6 @@ void Panels::FramelimiterPanel::Apply() Panels::FrameSkipPanel::FrameSkipPanel( wxWindow* parent ) : BaseApplicableConfigPanel_SpecificConfig( parent ) { - SetMinWidth( 350 ); - const RadioPanelItem FrameskipOptions[] = { RadioPanelItem(