Conditional compilation for launcher icon spacing.

This commit is contained in:
Jeff Young 2021-02-14 18:34:08 +00:00
parent ec20121114
commit 339864f843
3 changed files with 12 additions and 3 deletions

View File

@ -26,6 +26,14 @@
#include "panel_kicad_launcher.h"
#ifdef __WXMAC__
constexpr int ICON_PADDING = 5;
constexpr int CELL_MARGINS = 0;
#else
constexpr int ICON_PADDING = 5;
constexpr int CELL_MARGINS = 5;
#endif
PANEL_KICAD_LAUNCHER::PANEL_KICAD_LAUNCHER( wxWindow* aParent ) :
PANEL_KICAD_LAUNCHER_BASE( aParent )
{
@ -54,6 +62,7 @@ void PANEL_KICAD_LAUNCHER::CreateLaunchers()
{
BITMAP_BUTTON* btn = new BITMAP_BUTTON( this, wxID_ANY );
btn->SetBitmap( aBitmap );
btn->SetPadding( ICON_PADDING );
btn->SetToolTip( aAction.GetDescription() );
auto handler =
@ -78,7 +87,7 @@ void PANEL_KICAD_LAUNCHER::CreateLaunchers()
int row = m_toolsSizer->GetRows();
m_toolsSizer->Add( btn, wxGBPosition( row, 0 ), wxGBSpan( 2, 1 ), wxALL, 3 );
m_toolsSizer->Add( btn, wxGBPosition( row, 0 ), wxGBSpan( 2, 1 ), wxALL, CELL_MARGINS );
m_toolsSizer->Add( label, wxGBPosition( row, 1 ), wxGBSpan( 1, 1 ), wxALIGN_BOTTOM, 0 );
m_toolsSizer->Add( help, wxGBPosition( row + 1, 1 ), wxGBSpan( 1, 1 ), wxALIGN_TOP, 0 );
};

View File

@ -16,7 +16,7 @@ PANEL_KICAD_LAUNCHER_BASE::PANEL_KICAD_LAUNCHER_BASE( wxWindow* parent, wxWindow
m_mainSizer = new wxBoxSizer( wxVERTICAL );
m_toolsSizer = new wxGridBagSizer( 3, 12 );
m_toolsSizer = new wxGridBagSizer( 0, 12 );
m_toolsSizer->SetFlexibleDirection( wxHORIZONTAL );
m_toolsSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_NONE );

View File

@ -77,7 +77,7 @@
<property name="name">m_toolsSizer</property>
<property name="non_flexible_grow_mode">wxFLEX_GROWMODE_NONE</property>
<property name="permission">protected</property>
<property name="vgap">3</property>
<property name="vgap">0</property>
</object>
</object>
<object class="sizeritem" expanded="1">