From f4e7e201d8950f1f6176625d8b34744224d0f1f1 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Thu, 28 May 2020 22:16:23 +0100 Subject: [PATCH] Use a big hammer when beating wxWidgets over the head. --- common/dialogs/panel_mouse_settings.cpp | 14 ++++++++++ common/dialogs/panel_mouse_settings_base.cpp | 20 +++++++------- common/dialogs/panel_mouse_settings_base.fbp | 28 ++++++++++---------- common/dialogs/panel_mouse_settings_base.h | 2 ++ 4 files changed, 39 insertions(+), 25 deletions(-) diff --git a/common/dialogs/panel_mouse_settings.cpp b/common/dialogs/panel_mouse_settings.cpp index 5036f4db77..d111914861 100644 --- a/common/dialogs/panel_mouse_settings.cpp +++ b/common/dialogs/panel_mouse_settings.cpp @@ -33,6 +33,20 @@ PANEL_MOUSE_SETTINGS::PANEL_MOUSE_SETTINGS( DIALOG_SHIM* aDialog, wxWindow* aPar m_dialog( aDialog ), m_currentScrollMod( {} ) { +#ifdef __WXOSX_MAC__ + for( wxSizerItem* child : m_zoomSizer->GetChildren() ) + { + if( child->GetWindow() == m_zoomSpeed ) + child->SetBorder( 8 ); + } + + for( wxSizerItem* child : m_panSizer->GetChildren() ) + { + if( child->GetWindow() == m_autoPanSpeed ) + child->SetBorder( 8 ); + } +#endif + m_checkAutoZoomSpeed->Bind( wxEVT_COMMAND_CHECKBOX_CLICKED, [&]( wxCommandEvent& aEvt ) { diff --git a/common/dialogs/panel_mouse_settings_base.cpp b/common/dialogs/panel_mouse_settings_base.cpp index f2be44ba6b..e7cafc2854 100644 --- a/common/dialogs/panel_mouse_settings_base.cpp +++ b/common/dialogs/panel_mouse_settings_base.cpp @@ -40,44 +40,42 @@ PANEL_MOUSE_SETTINGS_BASE::PANEL_MOUSE_SETTINGS_BASE( wxWindow* parent, wxWindow gbSizer1->Add( m_checkZoomAcceleration, wxGBPosition( 1, 0 ), wxGBSpan( 1, 3 ), wxRIGHT|wxLEFT, 5 ); - wxBoxSizer* bSizer2; - bSizer2 = new wxBoxSizer( wxHORIZONTAL ); + m_zoomSizer = new wxBoxSizer( wxHORIZONTAL ); m_staticText1 = new wxStaticText( sbSizer1->GetStaticBox(), wxID_ANY, _("Zoom speed:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText1->Wrap( -1 ); - bSizer2->Add( m_staticText1, 0, wxBOTTOM|wxRIGHT|wxLEFT, 6 ); + m_zoomSizer->Add( m_staticText1, 0, wxRIGHT|wxLEFT, 8 ); m_zoomSpeed = new wxSlider( sbSizer1->GetStaticBox(), wxID_ANY, 5, 1, 10, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL ); m_zoomSpeed->Enable( false ); m_zoomSpeed->SetToolTip( _("How far to zoom in for each rotation of the mouse wheel") ); m_zoomSpeed->SetMinSize( wxSize( 150,-1 ) ); - bSizer2->Add( m_zoomSpeed, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT, 4 ); + m_zoomSizer->Add( m_zoomSpeed, 0, wxTOP|wxRIGHT|wxLEFT, 0 ); m_checkAutoZoomSpeed = new wxCheckBox( sbSizer1->GetStaticBox(), wxID_ANY, _("Automatic"), wxDefaultPosition, wxDefaultSize, 0 ); m_checkAutoZoomSpeed->SetValue(true); m_checkAutoZoomSpeed->SetToolTip( _("Pick the zoom speed automatically") ); - bSizer2->Add( m_checkAutoZoomSpeed, 0, wxBOTTOM|wxRIGHT|wxLEFT, 6 ); + m_zoomSizer->Add( m_checkAutoZoomSpeed, 0, wxRIGHT|wxLEFT, 10 ); - gbSizer1->Add( bSizer2, wxGBPosition( 2, 0 ), wxGBSpan( 1, 1 ), wxEXPAND|wxTOP, 5 ); + gbSizer1->Add( m_zoomSizer, wxGBPosition( 2, 0 ), wxGBSpan( 1, 1 ), wxEXPAND|wxTOP, 5 ); - wxBoxSizer* bSizer3; - bSizer3 = new wxBoxSizer( wxHORIZONTAL ); + m_panSizer = new wxBoxSizer( wxHORIZONTAL ); m_staticText22 = new wxStaticText( sbSizer1->GetStaticBox(), wxID_ANY, _("Auto pan speed:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText22->Wrap( -1 ); - bSizer3->Add( m_staticText22, 0, wxBOTTOM|wxRIGHT|wxLEFT, 6 ); + m_panSizer->Add( m_staticText22, 0, wxRIGHT|wxLEFT, 8 ); m_autoPanSpeed = new wxSlider( sbSizer1->GetStaticBox(), wxID_ANY, 5, 1, 10, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL ); m_autoPanSpeed->SetToolTip( _("How fast to pan when moving an object off the edge of the screen") ); m_autoPanSpeed->SetMinSize( wxSize( 150,-1 ) ); - bSizer3->Add( m_autoPanSpeed, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT, 4 ); + m_panSizer->Add( m_autoPanSpeed, 0, wxTOP|wxRIGHT|wxLEFT, 0 ); - gbSizer1->Add( bSizer3, wxGBPosition( 2, 2 ), wxGBSpan( 1, 1 ), wxEXPAND|wxTOP, 5 ); + gbSizer1->Add( m_panSizer, wxGBPosition( 2, 2 ), wxGBSpan( 1, 1 ), wxEXPAND|wxTOP, 5 ); gbSizer1->AddGrowableCol( 1 ); diff --git a/common/dialogs/panel_mouse_settings_base.fbp b/common/dialogs/panel_mouse_settings_base.fbp index b6569f36e7..c986c3b8ac 100644 --- a/common/dialogs/panel_mouse_settings_base.fbp +++ b/common/dialogs/panel_mouse_settings_base.fbp @@ -304,12 +304,12 @@ 1 - bSizer2 + m_zoomSizer wxHORIZONTAL - none + protected - 6 - wxBOTTOM|wxRIGHT|wxLEFT + 8 + wxRIGHT|wxLEFT 0 1 @@ -369,8 +369,8 @@ - 4 - wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT + 0 + wxTOP|wxRIGHT|wxLEFT 0 1 @@ -434,8 +434,8 @@ - 6 - wxBOTTOM|wxRIGHT|wxLEFT + 10 + wxRIGHT|wxLEFT 0 1 @@ -508,12 +508,12 @@ 1 - bSizer3 + m_panSizer wxHORIZONTAL - none + protected - 6 - wxBOTTOM|wxRIGHT|wxLEFT + 8 + wxRIGHT|wxLEFT 0 1 @@ -573,8 +573,8 @@ - 4 - wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT + 0 + wxTOP|wxRIGHT|wxLEFT 0 1 diff --git a/common/dialogs/panel_mouse_settings_base.h b/common/dialogs/panel_mouse_settings_base.h index e09647335b..e299382a84 100644 --- a/common/dialogs/panel_mouse_settings_base.h +++ b/common/dialogs/panel_mouse_settings_base.h @@ -38,9 +38,11 @@ class PANEL_MOUSE_SETTINGS_BASE : public wxPanel wxCheckBox* m_checkZoomCenter; wxCheckBox* m_checkAutoPan; wxCheckBox* m_checkZoomAcceleration; + wxBoxSizer* m_zoomSizer; wxStaticText* m_staticText1; wxSlider* m_zoomSpeed; wxCheckBox* m_checkAutoZoomSpeed; + wxBoxSizer* m_panSizer; wxStaticText* m_staticText22; wxSlider* m_autoPanSpeed; wxStaticText* m_staticText3;