From b55d760cd5d474c604a22fd935d4bf2ac532e7fb Mon Sep 17 00:00:00 2001 From: Alex Shvartzkop Date: Thu, 11 Apr 2024 00:47:27 +0300 Subject: [PATCH] Make grid cell editors with extra button consistent with normal text cell editors. (cherry picked from commit 5d22c1adee750f38e0f4350f3b653dbe25a305aa) --- common/widgets/grid_text_button_helpers.cpp | 24 ++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/common/widgets/grid_text_button_helpers.cpp b/common/widgets/grid_text_button_helpers.cpp index ba4afc1b42..b2568a6219 100644 --- a/common/widgets/grid_text_button_helpers.cpp +++ b/common/widgets/grid_text_button_helpers.cpp @@ -63,14 +63,6 @@ void GRID_CELL_TEXT_BUTTON::SetSize( const wxRect& aRect ) #if defined( __WXMAC__ ) rect.Inflate( 2 ); // ignore FOCUS_RING -#elif defined( __WXGTK__ ) - rect.Inflate( -3 ); // The -3 is a very sad hack here. Some GTK themes overrun the - // default -1, preventing display. Unfortunately, we don't appear to - // have a good method of finding the current margin needed. - // Some GTK resize events seem to update the cell size but not all and - // not consistently. -#else - rect.Inflate( -1 ); #endif Combo()->SetSize( rect, wxSIZE_ALLOW_MINUS_ONE ); @@ -234,6 +226,8 @@ void GRID_CELL_SYMBOL_ID_EDITOR::Create( wxWindow* aParent, wxWindowID aId, { m_control = new TEXT_BUTTON_SYMBOL_CHOOSER( aParent, m_dlg, m_preselect ); + Combo()->SetMargins( 0, 0 ); + wxGridCellEditor::Create( aParent, aId, aEventHandler ); } @@ -244,7 +238,7 @@ public: TEXT_BUTTON_FP_CHOOSER( wxWindow* aParent, DIALOG_SHIM* aParentDlg, const wxString& aSymbolNetlist, const wxString& aPreselect ) : wxComboCtrl( aParent, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, - wxTE_PROCESS_ENTER ), + wxTE_PROCESS_ENTER | wxBORDER_NONE ), m_dlg( aParentDlg ), m_preselect( aPreselect ), m_symbolNetlist( aSymbolNetlist.ToStdString() ) @@ -317,6 +311,8 @@ void GRID_CELL_FPID_EDITOR::Create( wxWindow* aParent, wxWindowID aId, { m_control = new TEXT_BUTTON_FP_CHOOSER( aParent, m_dlg, m_symbolNetlist, m_preselect ); + Combo()->SetMargins( 0, 0 ); + #if wxUSE_VALIDATORS // validate text in textctrl, if validator is set if ( m_validator ) @@ -334,7 +330,7 @@ class TEXT_BUTTON_URL : public wxComboCtrl public: TEXT_BUTTON_URL( wxWindow* aParent, DIALOG_SHIM* aParentDlg, SEARCH_STACK* aSearchStack ) : wxComboCtrl( aParent, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, - wxTE_PROCESS_ENTER ), + wxTE_PROCESS_ENTER | wxBORDER_NONE ), m_dlg( aParentDlg ), m_searchStack( aSearchStack ) { @@ -368,6 +364,8 @@ void GRID_CELL_URL_EDITOR::Create( wxWindow* aParent, wxWindowID aId, { m_control = new TEXT_BUTTON_URL( aParent, m_dlg, m_searchStack ); + Combo()->SetMargins( 0, 0 ); + #if wxUSE_VALIDATORS // validate text in textctrl, if validator is set if ( m_validator ) @@ -388,7 +386,7 @@ public: bool aNormalize = false, const wxString& aNormalizeBasePath = wxEmptyString ) : wxComboCtrl( aParent, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, - wxTE_PROCESS_ENTER ), + wxTE_PROCESS_ENTER | wxBORDER_NONE ), m_dlg( aParentDlg ), m_grid( aGrid ), m_currentDir( aCurrentDir ), @@ -408,7 +406,7 @@ public: bool aNormalize = false, const wxString& aNormalizeBasePath = wxEmptyString ) : wxComboCtrl( aParent, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, - wxTE_PROCESS_ENTER ), + wxTE_PROCESS_ENTER | wxBORDER_NONE ), m_dlg( aParentDlg ), m_grid( aGrid ), m_currentDir( aCurrentDir ), @@ -524,6 +522,8 @@ 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 ); + #if wxUSE_VALIDATORS // validate text in textctrl, if validator is set if ( m_validator )