From e841ca19061fdfbe05e3be9fd2556756eabda410 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Tue, 19 Aug 2025 12:52:21 +0100 Subject: [PATCH] Add spacing for Mac file dialog custom controls. --- eeschema/widgets/filedlg_hook_save_project.h | 4 ++++ eeschema/widgets/sch_design_block_pane.cpp | 4 ++++ .../symbol_library_save_as_filedlg_hook.h | 16 ++++++++++++---- include/widgets/filedlg_hook_embed_file.h | 4 ++++ include/widgets/filedlg_hook_new_library.h | 12 +++++++++--- include/widgets/filedlg_import_non_kicad.h | 5 +++++ kicad/widgets/filedlg_new_project.h | 4 ++++ pcbnew/exporters/export_d356.cpp | 4 ++++ pcbnew/widgets/filedlg_hook_save_project.h | 4 ++++ 9 files changed, 50 insertions(+), 7 deletions(-) diff --git a/eeschema/widgets/filedlg_hook_save_project.h b/eeschema/widgets/filedlg_hook_save_project.h index 28a66f9777..f1a7f4db8e 100644 --- a/eeschema/widgets/filedlg_hook_save_project.h +++ b/eeschema/widgets/filedlg_hook_save_project.h @@ -29,6 +29,10 @@ public: virtual void AddCustomControls( wxFileDialogCustomize& customizer ) override { +#ifdef __WXMAC__ + customizer.AddStaticText( wxT( "\n\n" ) ); +#endif + m_cb = customizer.AddCheckBox( _( "Create a new project for this schematic" ) ); m_cb->SetValue( true ); diff --git a/eeschema/widgets/sch_design_block_pane.cpp b/eeschema/widgets/sch_design_block_pane.cpp index 9a4e0e20b3..1ba09e88c9 100644 --- a/eeschema/widgets/sch_design_block_pane.cpp +++ b/eeschema/widgets/sch_design_block_pane.cpp @@ -173,6 +173,10 @@ void FILEDLG_IMPORT_SHEET_CONTENTS::TransferDataFromCustomControls() void FILEDLG_IMPORT_SHEET_CONTENTS::AddCustomControls( wxFileDialogCustomize& customizer ) { +#ifdef __WXMAC__ + customizer.AddStaticText( wxT( "\n\n" ) ); // Increase height of static box +#endif + m_cbRepeatedPlacement = customizer.AddCheckBox( REPEATED_PLACEMENT ); m_cbRepeatedPlacement->SetValue( m_settings->m_DesignBlockChooserPanel.repeated_placement ); m_cbPlaceAsGroup = customizer.AddCheckBox( PLACE_AS_GROUP ); diff --git a/eeschema/widgets/symbol_library_save_as_filedlg_hook.h b/eeschema/widgets/symbol_library_save_as_filedlg_hook.h index bf9485189c..339bfa9a78 100644 --- a/eeschema/widgets/symbol_library_save_as_filedlg_hook.h +++ b/eeschema/widgets/symbol_library_save_as_filedlg_hook.h @@ -32,10 +32,18 @@ public: virtual void AddCustomControls( wxFileDialogCustomize& customizer ) override { - m_simpleSaveAs = customizer.AddRadioButton( _( "Do not update library tables" ) ); - m_replaceTableEntry = customizer.AddRadioButton( _( "Update existing library table entry" ) ); - m_addGlobalTableEntry = customizer.AddRadioButton( _( "Add new global library table entry" ) ); - m_addProjectTableEntry = customizer.AddRadioButton( _( "Add new project library table entry" ) ); + wxString padding; +#ifdef __WXMAC__ + padding = wxT( " " ); + customizer.AddStaticText( padding + wxT( "\n\n" ) ); // Increase height of static box +#endif + + // Radio buttons are only grouped if they are consecutive. If we want padding, we need to add it + // to the radio button labels + m_simpleSaveAs = customizer.AddRadioButton( _( "Do not update library tables" ) + padding ); + m_replaceTableEntry = customizer.AddRadioButton( _( "Update existing library table entry" ) + padding ); + m_addGlobalTableEntry = customizer.AddRadioButton( _( "Add new global library table entry" ) + padding ); + m_addProjectTableEntry = customizer.AddRadioButton( _( "Add new project library table entry" ) + padding ); // Note, due to windows api, wx does not actually support calling SetValue( false ) (it asserts) if( m_option == SYMBOL_SAVEAS_TYPE::NORMAL_SAVE_AS ) diff --git a/include/widgets/filedlg_hook_embed_file.h b/include/widgets/filedlg_hook_embed_file.h index 4a0d4c1639..d7bcb80157 100644 --- a/include/widgets/filedlg_hook_embed_file.h +++ b/include/widgets/filedlg_hook_embed_file.h @@ -31,6 +31,10 @@ public: virtual void AddCustomControls( wxFileDialogCustomize& customizer ) override { +#ifdef __WXMAC__ + customizer.AddStaticText( wxT( "\n\n" ) ); // Increase height of static box +#endif + m_cb = customizer.AddCheckBox( _( "Embed file" ) ); m_cb->SetValue( m_embed ); } diff --git a/include/widgets/filedlg_hook_new_library.h b/include/widgets/filedlg_hook_new_library.h index 3ffb289587..4a6241faf8 100644 --- a/include/widgets/filedlg_hook_new_library.h +++ b/include/widgets/filedlg_hook_new_library.h @@ -31,9 +31,15 @@ public: virtual void AddCustomControls( wxFileDialogCustomize& customizer ) override { - // Radio buttons are only grouped if they are consecutive. Since we want padding, we need to - // Add padding to the first radio button - m_addGlobalTableEntry = customizer.AddRadioButton( _( "Add new library to global library table" ) ); + wxString padding; +#ifdef __WXMAC__ + padding = wxT( " " ); + customizer.AddStaticText( wxT( "\n\n" ) ); +#endif + + // Radio buttons are only grouped if they are consecutive. If we want padding, we need to add it to the + // first radio button + m_addGlobalTableEntry = customizer.AddRadioButton( _( "Add new library to global library table" ) + padding ); m_addProjectTableEntry = customizer.AddRadioButton( _( "Add new library to project library table" ) ); if( m_useGlobalTable ) diff --git a/include/widgets/filedlg_import_non_kicad.h b/include/widgets/filedlg_import_non_kicad.h index 299ff10dff..795004ffb2 100644 --- a/include/widgets/filedlg_import_non_kicad.h +++ b/include/widgets/filedlg_import_non_kicad.h @@ -31,6 +31,11 @@ public: virtual void AddCustomControls( wxFileDialogCustomize& customizer ) override { + wxString padding; +#ifdef __WXMAC__ + customizer.AddStaticText( wxT( "\n\n" ) ); // Increase height of static box +#endif + m_cb = customizer.AddCheckBox( _( "Show import issues" ) ); m_cb->SetValue( m_showIssues ); } diff --git a/kicad/widgets/filedlg_new_project.h b/kicad/widgets/filedlg_new_project.h index ef4eec66ec..e6cf502303 100644 --- a/kicad/widgets/filedlg_new_project.h +++ b/kicad/widgets/filedlg_new_project.h @@ -29,6 +29,10 @@ public: virtual void AddCustomControls( wxFileDialogCustomize& customizer ) override { +#ifdef __WXMAC__ + customizer.AddStaticText( wxT( "\n\n" ) ); // Increase height of static box +#endif + m_cb = customizer.AddCheckBox( _( "Create a new folder for the project" ) ); m_cb->SetValue( true ); } diff --git a/pcbnew/exporters/export_d356.cpp b/pcbnew/exporters/export_d356.cpp index 2dfeadb12d..dc09d8d2e1 100644 --- a/pcbnew/exporters/export_d356.cpp +++ b/pcbnew/exporters/export_d356.cpp @@ -406,6 +406,10 @@ public: virtual void AddCustomControls( wxFileDialogCustomize& customizer ) override { +#ifdef __WXMAC__ + customizer.AddStaticText( wxT( "\n\n" ) ); // Increase height of static box +#endif + m_cb = customizer.AddCheckBox( _( "Do not export unconnected pads" ) ); m_cb->SetValue( m_doNotExportUnconnectedPads ); } diff --git a/pcbnew/widgets/filedlg_hook_save_project.h b/pcbnew/widgets/filedlg_hook_save_project.h index 3657575dcb..337df39470 100644 --- a/pcbnew/widgets/filedlg_hook_save_project.h +++ b/pcbnew/widgets/filedlg_hook_save_project.h @@ -29,6 +29,10 @@ public: virtual void AddCustomControls( wxFileDialogCustomize& customizer ) override { +#ifdef __WXMAC__ + customizer.AddStaticText( wxT( "\n\n" ) ); // Increase height of static box +#endif + m_cb = customizer.AddCheckBox( _( "Create a new project for this board" ) ); m_cb->SetValue( true );