diff --git a/common/widgets/grid_text_button_helpers.cpp b/common/widgets/grid_text_button_helpers.cpp index 5a2f05cd96..7ae8f675f8 100644 --- a/common/widgets/grid_text_button_helpers.cpp +++ b/common/widgets/grid_text_button_helpers.cpp @@ -41,6 +41,16 @@ #include +static void setTextMargins( wxTextEntryBase* aEntry ) +{ +#if defined( __WXMSW__ ) + aEntry->SetMargins( 2, 2 ); +#elif defined( __WXGTK__ ) + aEntry->SetMargins( 0, 0 ); +#endif +} + + //-------- Renderer --------------------------------------------------------------------- // None required; just render as normal text. @@ -217,8 +227,7 @@ void GRID_CELL_SYMBOL_ID_EDITOR::Create( wxWindow* aParent, wxWindowID aId, wxEvtHandler* aEventHandler ) { m_control = new TEXT_BUTTON_SYMBOL_CHOOSER( aParent, m_dlg, m_preselect ); - - Combo()->SetMargins( 0, 0 ); + setTextMargins( Combo() ); wxGridCellEditor::Create( aParent, aId, aEventHandler ); } @@ -286,8 +295,7 @@ void GRID_CELL_FPID_EDITOR::Create( wxWindow* aParent, wxWindowID aId, wxEvtHandler* aEventHandler ) { m_control = new TEXT_BUTTON_FP_CHOOSER( aParent, m_dlg, m_symbolNetlist, m_preselect ); - - Combo()->SetMargins( 0, 0 ); + setTextMargins( Combo() ); #if wxUSE_VALIDATORS // validate text in textctrl, if validator is set @@ -339,8 +347,7 @@ void GRID_CELL_URL_EDITOR::Create( wxWindow* aParent, wxWindowID aId, wxEvtHandler* aEventHandler ) { m_control = new TEXT_BUTTON_URL( aParent, m_dlg, m_searchStack ); - - Combo()->SetMargins( 0, 0 ); + setTextMargins( Combo() ); #if wxUSE_VALIDATORS // validate text in textctrl, if validator is set @@ -498,7 +505,7 @@ void GRID_CELL_PATH_EDITOR::Create( wxWindow* aParent, wxWindowID aId, m_control = new TEXT_BUTTON_FILE_BROWSER( aParent, m_dlg, m_grid, m_currentDir, m_fileFilter, m_normalize, m_normalizeBasePath ); - Combo()->SetMargins( 0, 0 ); + setTextMargins( Combo() ); #if wxUSE_VALIDATORS // validate text in textctrl, if validator is set