TreeSearch: Clear filter only when really necessary.
This commit is contained in:
parent
88a617aa42
commit
f00d1bfb40
|
@ -66,9 +66,8 @@ void TreeSearch::_filter_tree() {
|
||||||
void TreeSearch::_filter_tree(TreeItem *p_item, bool p_parent_matching) {
|
void TreeSearch::_filter_tree(TreeItem *p_item, bool p_parent_matching) {
|
||||||
bool visible = number_matches.has(p_item) | p_parent_matching;
|
bool visible = number_matches.has(p_item) | p_parent_matching;
|
||||||
|
|
||||||
if (!visible) {
|
|
||||||
p_item->set_visible(visible);
|
p_item->set_visible(visible);
|
||||||
}
|
|
||||||
bool is_matching = _vector_has_bsearch(matching_entries, p_item);
|
bool is_matching = _vector_has_bsearch(matching_entries, p_item);
|
||||||
for (int i = 0; i < p_item->get_child_count(); i++) {
|
for (int i = 0; i < p_item->get_child_count(); i++) {
|
||||||
_filter_tree(p_item->get_child(i), is_matching | p_parent_matching);
|
_filter_tree(p_item->get_child(i), is_matching | p_parent_matching);
|
||||||
|
@ -475,7 +474,6 @@ void TreeSearch::update_search(Tree *p_tree) {
|
||||||
_update_matching_entries(search_mask);
|
_update_matching_entries(search_mask);
|
||||||
_update_number_matches();
|
_update_number_matches();
|
||||||
|
|
||||||
_clear_filter();
|
|
||||||
_highlight_tree();
|
_highlight_tree();
|
||||||
if (search_mode == TreeSearchMode::FILTER) {
|
if (search_mode == TreeSearchMode::FILTER) {
|
||||||
_filter_tree();
|
_filter_tree();
|
||||||
|
|
Loading…
Reference in New Issue