Search: Fixed a blinking for the first search

This commit is contained in:
YuSanka 2021-07-26 15:06:06 +02:00
parent 0584b13167
commit 5f73724501

View file

@ -1173,6 +1173,10 @@ void Tab::activate_option(const std::string& opt_key, const wxString& category)
if (!cur_item) if (!cur_item)
return; return;
// We should to activate a tab with searched option, if it doesn't.
// And do it before finding of the cur_item to avoid a case when Tab isn't activated jet and all treeItems are invisible
wxGetApp().mainframe->select_tab(this);
while (cur_item) { while (cur_item) {
auto title = m_treectrl->GetItemText(cur_item); auto title = m_treectrl->GetItemText(cur_item);
if (page_title != title) { if (page_title != title) {
@ -1184,8 +1188,6 @@ void Tab::activate_option(const std::string& opt_key, const wxString& category)
break; break;
} }
// we should to activate a tab with searched option, if it doesn't.
wxGetApp().mainframe->select_tab(this);
Field* field = get_field(opt_key); Field* field = get_field(opt_key);
// focused selected field // focused selected field