From 875fcffdf91c121592f206bc33af430847ffeab1 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Mon, 28 Jul 2025 19:37:32 +0100 Subject: [PATCH] Mac has no fallback graphics. --- common/dialogs/panel_common_settings.cpp | 10 +- common/dialogs/panel_common_settings_base.cpp | 54 +-- common/dialogs/panel_common_settings_base.fbp | 343 ++++++++++-------- common/dialogs/panel_common_settings_base.h | 7 +- common/widgets/gal_options_panel.cpp | 4 +- kicad/kicad.cpp | 2 + 6 files changed, 232 insertions(+), 188 deletions(-) diff --git a/common/dialogs/panel_common_settings.cpp b/common/dialogs/panel_common_settings.cpp index 564e239482..7b813a21e8 100644 --- a/common/dialogs/panel_common_settings.cpp +++ b/common/dialogs/panel_common_settings.cpp @@ -45,9 +45,15 @@ * Ugly as it all is, it does improve our usability on various platforms. */ -PANEL_COMMON_SETTINGS::PANEL_COMMON_SETTINGS( wxWindow* aParent ) - : PANEL_COMMON_SETTINGS_BASE( aParent ) +PANEL_COMMON_SETTINGS::PANEL_COMMON_SETTINGS( wxWindow* aParent ) : + PANEL_COMMON_SETTINGS_BASE( aParent ) { + // Rendering engine +#ifdef __WXMAC__ + // On MAC, Cairo render does not work. + m_renderingSizer->Show( false ); +#endif + ShowFileManagerWidgets( ADVANCED_CFG::GetCfg().m_EnableLibDir ); m_textEditorBtn->SetBitmap( KiBitmapBundle( BITMAPS::small_folder ) ); diff --git a/common/dialogs/panel_common_settings_base.cpp b/common/dialogs/panel_common_settings_base.cpp index f14f977153..85a0cdac46 100644 --- a/common/dialogs/panel_common_settings_base.cpp +++ b/common/dialogs/panel_common_settings_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6a-dirty) +// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -26,8 +26,31 @@ PANEL_COMMON_SETTINGS_BASE::PANEL_COMMON_SETTINGS_BASE( wxWindow* parent, wxWind m_staticline3 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); bLeftSizer->Add( m_staticline3, 0, wxEXPAND|wxTOP|wxBOTTOM, 2 ); + + bLeftSizer->Add( 0, 3, 0, 0, 5 ); + + m_renderingSizer = new wxFlexGridSizer( 0, 1, 4, 0 ); + m_renderingSizer->SetFlexibleDirection( wxBOTH ); + m_renderingSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); + + m_rbAccelerated = new wxRadioButton( this, wxID_ANY, _("Accelerated Graphics"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP ); + m_rbAccelerated->SetToolTip( _("Hardware-accelerated graphics (recommended)") ); + + m_renderingSizer->Add( m_rbAccelerated, 0, wxLEFT, 5 ); + + m_rbFallback = new wxRadioButton( this, wxID_ANY, _("Fallback Graphics"), wxDefaultPosition, wxDefaultSize, 0 ); + m_rbFallback->SetToolTip( _("Software graphics (for computers which do not support KiCad's hardware acceleration requirements)") ); + + m_renderingSizer->Add( m_rbFallback, 0, wxLEFT, 5 ); + + + bLeftSizer->Add( m_renderingSizer, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); + + + bLeftSizer->Add( 0, 3, 0, 0, 5 ); + wxGridBagSizer* gbSizer11; - gbSizer11 = new wxGridBagSizer( 2, 4 ); + gbSizer11 = new wxGridBagSizer( 0, 6 ); gbSizer11->SetFlexibleDirection( wxBOTH ); gbSizer11->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); gbSizer11->SetEmptyCellSize( wxSize( -1,2 ) ); @@ -41,25 +64,7 @@ PANEL_COMMON_SETTINGS_BASE::PANEL_COMMON_SETTINGS_BASE( wxWindow* parent, wxWind int m_antialiasingNChoices = sizeof( m_antialiasingChoices ) / sizeof( wxString ); m_antialiasing = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_antialiasingNChoices, m_antialiasingChoices, 0 ); m_antialiasing->SetSelection( 0 ); - gbSizer11->Add( m_antialiasing, wxGBPosition( 2, 1 ), wxGBSpan( 1, 1 ), wxALL, 5 ); - - wxFlexGridSizer* fgSizer1; - fgSizer1 = new wxFlexGridSizer( 0, 1, 4, 0 ); - fgSizer1->SetFlexibleDirection( wxBOTH ); - fgSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - - m_rbAccelerated = new wxRadioButton( this, wxID_ANY, _("Accelerated Graphics"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP ); - m_rbAccelerated->SetToolTip( _("Hardware-accelerated graphics (recommended)") ); - - fgSizer1->Add( m_rbAccelerated, 0, wxLEFT, 5 ); - - m_rbFallback = new wxRadioButton( this, wxID_ANY, _("Fallback Graphics"), wxDefaultPosition, wxDefaultSize, 0 ); - m_rbFallback->SetToolTip( _("Software graphics (for computers which do not support KiCad's hardware acceleration requirements)") ); - - fgSizer1->Add( m_rbFallback, 0, wxLEFT|wxTOP, 5 ); - - - gbSizer11->Add( fgSizer1, wxGBPosition( 0, 1 ), wxGBSpan( 1, 1 ), wxEXPAND, 0 ); + gbSizer11->Add( m_antialiasing, wxGBPosition( 2, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); gbSizer11->AddGrowableCol( 1 ); @@ -102,6 +107,9 @@ PANEL_COMMON_SETTINGS_BASE::PANEL_COMMON_SETTINGS_BASE( wxWindow* parent, wxWind bHelperAppsSizer->Add( bSizer61, 0, wxTOP|wxRIGHT|wxEXPAND, 5 ); + + bHelperAppsSizer->Add( 0, 4, 0, wxEXPAND, 5 ); + bSizerFileManager = new wxBoxSizer( wxHORIZONTAL ); m_staticTextFileManager = new wxStaticText( this, wxID_ANY, _("File manager:"), wxDefaultPosition, wxDefaultSize, 0 ); @@ -115,7 +123,7 @@ PANEL_COMMON_SETTINGS_BASE::PANEL_COMMON_SETTINGS_BASE( wxWindow* parent, wxWind bHelperAppsSizer->Add( bSizerFileManager, 0, wxEXPAND|wxRIGHT|wxTOP, 5 ); - bHelperAppsSizer->Add( 0, 12, 0, wxEXPAND, 5 ); + bHelperAppsSizer->Add( 0, 12, 1, wxEXPAND, 5 ); wxBoxSizer* bSizer8; bSizer8 = new wxBoxSizer( wxVERTICAL ); @@ -124,7 +132,7 @@ PANEL_COMMON_SETTINGS_BASE::PANEL_COMMON_SETTINGS_BASE( wxWindow* parent, wxWind bSizer8->Add( m_defaultPDFViewer, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); - bHelperAppsSizer->Add( bSizer8, 0, wxBOTTOM|wxEXPAND, 3 ); + bHelperAppsSizer->Add( bSizer8, 0, wxBOTTOM|wxEXPAND, 2 ); wxBoxSizer* bSizer7; bSizer7 = new wxBoxSizer( wxHORIZONTAL ); diff --git a/common/dialogs/panel_common_settings_base.fbp b/common/dialogs/panel_common_settings_base.fbp index b3bd2f272f..dcf4cd27d7 100644 --- a/common/dialogs/panel_common_settings_base.fbp +++ b/common/dialogs/panel_common_settings_base.fbp @@ -190,6 +190,174 @@ + + 5 + + 0 + + 3 + protected + 0 + + + + 5 + wxEXPAND|wxTOP|wxRIGHT|wxLEFT + 1 + + 1 + wxBOTH + + + 0 + + m_renderingSizer + wxFLEX_GROWMODE_SPECIFIED + protected + 0 + 4 + + 5 + wxLEFT + 0 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + Accelerated Graphics + + 0 + + + 0 + + 1 + m_rbAccelerated + 1 + + + protected + 1 + + Resizable + 1 + + wxRB_GROUP + ; ; forward_declare + 0 + Hardware-accelerated graphics (recommended) + + wxFILTER_NONE + wxDefaultValidator + + 0 + + + + + + + 5 + wxLEFT + 0 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + Fallback Graphics + + 0 + + + 0 + + 1 + m_rbFallback + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + Software graphics (for computers which do not support KiCad's hardware acceleration requirements) + + wxFILTER_NONE + wxDefaultValidator + + 0 + + + + + + + + + 5 + + 0 + + 3 + protected + 0 + + 5 wxLEFT @@ -199,12 +367,12 @@ wxBOTH 1 - 4 + 6 gbSizer11 wxFLEX_GROWMODE_SPECIFIED none - 2 + 0 5 1 @@ -274,7 +442,7 @@ 5 1 1 - wxALL + wxALIGN_CENTER_VERTICAL|wxRIGHT 2 1 @@ -338,157 +506,6 @@ - - 0 - 1 - 1 - wxEXPAND - 0 - 1 - - 1 - wxBOTH - - - 0 - - fgSizer1 - wxFLEX_GROWMODE_SPECIFIED - none - 0 - 4 - - 5 - wxLEFT - 0 - - 1 - 1 - 1 - 1 - 0 - - 0 - 0 - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 0 - 1 - - 1 - - 0 - 0 - wxID_ANY - Accelerated Graphics - - 0 - - - 0 - - 1 - m_rbAccelerated - 1 - - - protected - 1 - - Resizable - 1 - - wxRB_GROUP - ; ; forward_declare - 0 - Hardware-accelerated graphics (recommended) - - wxFILTER_NONE - wxDefaultValidator - - 0 - - - - - - - 5 - wxLEFT|wxTOP - 0 - - 1 - 1 - 1 - 1 - 0 - - 0 - 0 - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 0 - 1 - - 1 - - 0 - 0 - wxID_ANY - Fallback Graphics - - 0 - - - 0 - - 1 - m_rbFallback - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - Software graphics (for computers which do not support KiCad's hardware acceleration requirements) - - wxFILTER_NONE - wxDefaultValidator - - 0 - - - - - - - @@ -855,6 +872,16 @@ + + 5 + wxEXPAND + 0 + + 4 + protected + 0 + + 5 wxEXPAND|wxRIGHT|wxTOP @@ -993,18 +1020,18 @@ - + 5 wxEXPAND - 0 - + 1 + 12 protected 0 - 3 + 2 wxBOTTOM|wxEXPAND 0 diff --git a/common/dialogs/panel_common_settings_base.h b/common/dialogs/panel_common_settings_base.h index 2ba3060b98..a9f2040db1 100644 --- a/common/dialogs/panel_common_settings_base.h +++ b/common/dialogs/panel_common_settings_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6a-dirty) +// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -20,9 +20,9 @@ class STD_BITMAP_BUTTON; #include #include #include -#include #include #include +#include #include #include #include @@ -46,9 +46,10 @@ class PANEL_COMMON_SETTINGS_BASE : public RESETTABLE_PANEL protected: wxStaticText* m_staticText20; wxStaticLine* m_staticline3; - wxChoice* m_antialiasing; + wxFlexGridSizer* m_renderingSizer; wxRadioButton* m_rbAccelerated; wxRadioButton* m_rbFallback; + wxChoice* m_antialiasing; wxStaticText* m_staticText21; wxStaticLine* m_staticline2; wxTextCtrl* m_textEditorPath; diff --git a/common/widgets/gal_options_panel.cpp b/common/widgets/gal_options_panel.cpp index 1e176b9126..f9786bdc45 100644 --- a/common/widgets/gal_options_panel.cpp +++ b/common/widgets/gal_options_panel.cpp @@ -57,8 +57,8 @@ static const UTIL::CFG_MAP gridSnapConfigVals = GAL_OPTIONS_PANEL::GAL_OPTIONS_PANEL( wxWindow* aParent, APP_SETTINGS_BASE* aAppSettings ) : - GAL_OPTIONS_PANEL_BASE( aParent ), - m_cfg( aAppSettings ) + GAL_OPTIONS_PANEL_BASE( aParent ), + m_cfg( aAppSettings ) { // Grid settings subpanel int selection = 0; // default selection diff --git a/kicad/kicad.cpp b/kicad/kicad.cpp index dc98263a2a..b02f16d69a 100644 --- a/kicad/kicad.cpp +++ b/kicad/kicad.cpp @@ -162,10 +162,12 @@ bool PGM_KICAD::OnPgmInit() Kiway.SetCtlBits( KFCTL_STANDALONE ); } +#ifndef __WXMAC__ if( parser.Found( "software-rendering" ) ) { wxSetEnv( "KICAD_SOFTWARE_RENDERING", "1" ); } +#endif bool skipPythonInit = false;