Copy 2 bug fixes from OnSizeFieldsGrid() to OnSizePinsGrid()

Fixes https://gitlab.com/kicad/code/kicad/-/issues/16332
This commit is contained in:
Jeff Young 2023-12-14 12:23:50 +00:00
parent 358a2b9875
commit 5709d57824
2 changed files with 14 additions and 9 deletions

View File

@ -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();
}

View File

@ -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;