From 5709d57824ac94b8647d8f64f0157cda5d773583 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Thu, 14 Dec 2023 12:23:50 +0000 Subject: [PATCH] Copy 2 bug fixes from OnSizeFieldsGrid() to OnSizePinsGrid() Fixes https://gitlab.com/kicad/code/kicad/-/issues/16332 --- eeschema/dialogs/dialog_symbol_properties.cpp | 18 ++++++++++++------ eeschema/dialogs/dialog_symbol_properties.h | 5 ++--- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/eeschema/dialogs/dialog_symbol_properties.cpp b/eeschema/dialogs/dialog_symbol_properties.cpp index 5789657703..6e34b12db7 100644 --- a/eeschema/dialogs/dialog_symbol_properties.cpp +++ b/eeschema/dialogs/dialog_symbol_properties.cpp @@ -313,7 +313,8 @@ DIALOG_SYMBOL_PROPERTIES::DIALOG_SYMBOL_PROPERTIES( SCH_EDIT_FRAME* aParent, m_symbol( nullptr ), m_part( nullptr ), m_fieldsSize( 0, 0 ), - m_lastRequestedSize( 0, 0 ), + m_lastRequestedFieldsSize( 0, 0 ), + m_lastRequestedPinsSize( 0, 0 ), m_editorShown( false ), m_fields( nullptr ), m_dataModel( nullptr ) @@ -1187,7 +1188,7 @@ void DIALOG_SYMBOL_PROPERTIES::OnSizeFieldsGrid( wxSizeEvent& event ) { wxSize new_size = event.GetSize(); - if( ( !m_editorShown || m_lastRequestedSize != new_size ) && m_fieldsSize != new_size ) + if( ( !m_editorShown || m_lastRequestedFieldsSize != new_size ) && m_fieldsSize != new_size ) { m_fieldsSize = new_size; @@ -1195,9 +1196,9 @@ void DIALOG_SYMBOL_PROPERTIES::OnSizeFieldsGrid( wxSizeEvent& event ) } // We store this value to check whether the dialog is changing size. This might indicate - // that the user is scaling the dialog with an editor shown. Some editors do not close - // (at least on GTK) when the user drags a dialog corner - m_lastRequestedSize = new_size; + // that the user is scaling the dialog with a grid-cell-editor shown. Some editors do not + // close (at least on GTK) when the user drags a dialog corner + m_lastRequestedFieldsSize = new_size; // Always propagate for a grid repaint (needed if the height changes, as well as width) event.Skip(); @@ -1208,13 +1209,18 @@ void DIALOG_SYMBOL_PROPERTIES::OnSizePinsGrid( wxSizeEvent& event ) { wxSize new_size = event.GetSize(); - if( m_pinsSize != new_size ) + if( ( !m_editorShown || m_lastRequestedPinsSize != new_size ) && m_pinsSize != new_size ) { m_pinsSize = new_size; AdjustPinsGridColumns(); } + // We store this value to check whether the dialog is changing size. This might indicate + // that the user is scaling the dialog with a grid-cell-editor shown. Some editors do not + // close (at least on GTK) when the user drags a dialog corner + m_lastRequestedPinsSize = new_size; + // Always propagate for a grid repaint (needed if the height changes, as well as width) event.Skip(); } diff --git a/eeschema/dialogs/dialog_symbol_properties.h b/eeschema/dialogs/dialog_symbol_properties.h index 8bc9492ebf..51181fb86d 100644 --- a/eeschema/dialogs/dialog_symbol_properties.h +++ b/eeschema/dialogs/dialog_symbol_properties.h @@ -98,15 +98,14 @@ private: virtual void onUpdateEditSymbol( wxUpdateUIEvent& event ) override; virtual void onUpdateEditLibrarySymbol( wxUpdateUIEvent& event ) override; - void AdjustGridColumns( int aWidth ); - private: SCH_SYMBOL* m_symbol; LIB_SYMBOL* m_part; wxSize m_fieldsSize; - wxSize m_lastRequestedSize; + wxSize m_lastRequestedFieldsSize; wxSize m_pinsSize; + wxSize m_lastRequestedPinsSize; bool m_editorShown; std::bitset<64> m_shownColumns;