libedit: Control resize requests
Another GTK3 dialog with excessive resize requests. Control the number for re-draws based on grid size. Fixes: lp:1818325 * https://bugs.launchpad.net/kicad/+bug/1818325
This commit is contained in:
parent
8d26b07f67
commit
84a1772e66
|
@ -68,7 +68,8 @@ DIALOG_EDIT_COMPONENT_IN_LIBRARY::DIALOG_EDIT_COMPONENT_IN_LIBRARY( LIB_EDIT_FRA
|
|||
m_delayedFocusGrid( nullptr ),
|
||||
m_delayedFocusRow( -1 ),
|
||||
m_delayedFocusColumn( -1 ),
|
||||
m_delayedFocusPage( -1 )
|
||||
m_delayedFocusPage( -1 ),
|
||||
m_width( 0 )
|
||||
{
|
||||
m_config = Kiface().KifaceSettings();
|
||||
|
||||
|
@ -800,6 +801,8 @@ void DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnEditFootprintFilter( wxCommandEvent& ev
|
|||
|
||||
void DIALOG_EDIT_COMPONENT_IN_LIBRARY::adjustGridColumns( int aWidth )
|
||||
{
|
||||
m_width = aWidth;
|
||||
|
||||
// Account for scroll bars
|
||||
aWidth -= ( m_grid->GetSize().x - m_grid->GetClientSize().x );
|
||||
|
||||
|
@ -906,10 +909,14 @@ void DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnUpdateUI( wxUpdateUIEvent& event )
|
|||
|
||||
void DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnSizeGrid( wxSizeEvent& event )
|
||||
{
|
||||
adjustGridColumns( event.GetSize().GetX() );
|
||||
auto new_size = event.GetSize().GetX();
|
||||
|
||||
if( new_size != m_width )
|
||||
{
|
||||
adjustGridColumns( event.GetSize().GetX() );
|
||||
event.Skip();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnSizeAliasGrid( wxSizeEvent& event )
|
||||
|
|
|
@ -60,6 +60,7 @@ public:
|
|||
wxString m_delayedErrorMessage;
|
||||
|
||||
wxString m_shownColumns;
|
||||
int m_width;
|
||||
|
||||
bool TransferDataToWindow() override;
|
||||
bool TransferDataFromWindow() override;
|
||||
|
|
Loading…
Reference in New Issue