Footprint Editor: Focus search field when window is first opened
The search field on the Symbol Editor is focused when its window is first opened. Similar behavior has been implemented in the search field of the Footprint Editor with this change. Fixes: https://gitlab.com/kicad/code/kicad/-/issues/13100
This commit is contained in:
parent
8e4911bba2
commit
b0cbab5c4b
|
@ -325,6 +325,15 @@ wxWindow* LIB_TREE::GetFocusTarget()
|
|||
}
|
||||
|
||||
|
||||
void LIB_TREE::FocusSearchFieldIfExists()
|
||||
{
|
||||
if( m_query_ctrl )
|
||||
{
|
||||
m_query_ctrl->SetFocus();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void LIB_TREE::toggleExpand( const wxDataViewItem& aTreeId )
|
||||
{
|
||||
if( !aTreeId.IsOk() )
|
||||
|
|
|
@ -139,6 +139,11 @@ public:
|
|||
|
||||
wxWindow* GetFocusTarget();
|
||||
|
||||
/**
|
||||
* Focus the search widget if it exists
|
||||
*/
|
||||
void FocusSearchFieldIfExists();
|
||||
|
||||
protected:
|
||||
/**
|
||||
* Expand or collapse a node, switching it to the opposite state.
|
||||
|
|
|
@ -309,11 +309,13 @@ FOOTPRINT_EDIT_FRAME::FOOTPRINT_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
|
|||
|
||||
// Register a call to update the toolbar sizes. It can't be done immediately because
|
||||
// it seems to require some sizes calculated that aren't yet (at least on GTK).
|
||||
CallAfter( [&]()
|
||||
{
|
||||
// Ensure the controls on the toolbars all are correctly sized
|
||||
UpdateToolbarControlSizes();
|
||||
} );
|
||||
CallAfter(
|
||||
[&]()
|
||||
{
|
||||
// Ensure the controls on the toolbars all are correctly sized
|
||||
UpdateToolbarControlSizes();
|
||||
m_treePane->FocusSearchFieldIfExists();
|
||||
} );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -50,6 +50,15 @@ FOOTPRINT_TREE_PANE::FOOTPRINT_TREE_PANE( FOOTPRINT_EDIT_FRAME* aParent )
|
|||
}
|
||||
|
||||
|
||||
void FOOTPRINT_TREE_PANE::FocusSearchFieldIfExists()
|
||||
{
|
||||
if( m_tree )
|
||||
{
|
||||
m_tree->FocusSearchFieldIfExists();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
FOOTPRINT_TREE_PANE::~FOOTPRINT_TREE_PANE()
|
||||
{
|
||||
m_tree->Destroy();
|
||||
|
|
|
@ -47,6 +47,11 @@ public:
|
|||
return m_tree;
|
||||
}
|
||||
|
||||
/**
|
||||
* Focus the search widget if it exists
|
||||
*/
|
||||
void FocusSearchFieldIfExists();
|
||||
|
||||
protected:
|
||||
void onComponentSelected( wxCommandEvent& aEvent );
|
||||
void onUpdateUI( wxUpdateUIEvent& aEvent );
|
||||
|
|
Loading…
Reference in New Issue