Browse Source

Force regeneration of the lib tree on first load

Just setting the text field is not guaranteed to fire
a text event, so we must forcefully call the regenerate
function to ensure the preselect is handled.

Fixes https://gitlab.com/kicad/code/kicad/issues/4105
pull/16/head
Ian McInerney 5 years ago
parent
commit
63b53c3968
  1. 6
      common/widgets/lib_tree.cpp

6
common/widgets/lib_tree.cpp

@ -117,8 +117,10 @@ LIB_TREE::LIB_TREE( wxWindow* aParent, LIB_TABLE* aLibTable, LIB_TREE_MODEL_ADAP
{
m_query_ctrl->SetHint( _( "Filter" ) );
m_query_ctrl->SetFocus();
m_query_ctrl->SetValue( wxEmptyString ); // SetValue() is required here to kick off
// initial sorting and pre-selection.
m_query_ctrl->SetValue( wxEmptyString );
// Force an update of the adapter with the empty text to ensure preselect is done
Regenerate( false );
}
// There may be a part preselected in the model. Make sure it is displayed.

Loading…
Cancel
Save