Compare commits
2 Commits
5607244db6
...
72b588af8f
Author | SHA1 | Date |
---|---|---|
monxa | 72b588af8f | |
Alexander Montag | 5ebb36077a |
|
@ -238,18 +238,14 @@ void TreeSearch::_update_ordered_tree_items(TreeItem *p_tree_item) {
|
||||||
|
|
||||||
void TreeSearch::_update_number_matches() {
|
void TreeSearch::_update_number_matches() {
|
||||||
ERR_FAIL_COND(!tree_reference);
|
ERR_FAIL_COND(!tree_reference);
|
||||||
|
|
||||||
number_matches.clear();
|
number_matches.clear();
|
||||||
number_matches.reserve(ordered_tree_items.size());
|
number_matches.reserve(ordered_tree_items.size());
|
||||||
|
|
||||||
TreeItem * tree_root = tree_reference->get_root();
|
|
||||||
if (!tree_root){
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
_update_number_matches(tree_reference->get_root());
|
_update_number_matches(tree_reference->get_root());
|
||||||
}
|
}
|
||||||
|
|
||||||
void TreeSearch::_update_number_matches(TreeItem *item) {
|
void TreeSearch::_update_number_matches(TreeItem *item) {
|
||||||
ERR_FAIL_COND(!item);
|
|
||||||
for (int i = 0; i < item->get_child_count(); i++) {
|
for (int i = 0; i < item->get_child_count(); i++) {
|
||||||
TreeItem *child = item->get_child(i);
|
TreeItem *child = item->get_child(i);
|
||||||
_update_number_matches(child);
|
_update_number_matches(child);
|
||||||
|
@ -268,7 +264,7 @@ void TreeSearch::_update_number_matches(TreeItem *item) {
|
||||||
}
|
}
|
||||||
|
|
||||||
String TreeSearch::_get_search_mask() const {
|
String TreeSearch::_get_search_mask() const {
|
||||||
ERR_FAIL_COND(!search_panel);
|
ERR_FAIL_COND_V(!search_panel, "");
|
||||||
return search_panel->get_text();
|
return search_panel->get_text();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -528,6 +524,7 @@ void TreeSearchPanel::_initialize_controls() {
|
||||||
find_next_button->set_theme_type_variation(LW_NAME(FlatButton));
|
find_next_button->set_theme_type_variation(LW_NAME(FlatButton));
|
||||||
find_prev_button->set_theme_type_variation(LW_NAME(FlatButton));
|
find_prev_button->set_theme_type_variation(LW_NAME(FlatButton));
|
||||||
|
|
||||||
|
close_button->set_tooltip_text("Hide");
|
||||||
find_next_button->set_tooltip_text("Next Match");
|
find_next_button->set_tooltip_text("Next Match");
|
||||||
find_prev_button->set_tooltip_text("Previous Match");
|
find_prev_button->set_tooltip_text("Previous Match");
|
||||||
|
|
||||||
|
@ -562,7 +559,7 @@ void TreeSearchPanel::_notification(int p_what) {
|
||||||
// Close callbacks
|
// Close callbacks
|
||||||
close_button->connect(LW_NAME(pressed), Callable(this, LW_NAME(set_visible)).bind(false));
|
close_button->connect(LW_NAME(pressed), Callable(this, LW_NAME(set_visible)).bind(false));
|
||||||
close_button->connect(LW_NAME(pressed), Callable(this, LW_NAME(emit_signal)).bind(LW_NAME(Close)));
|
close_button->connect(LW_NAME(pressed), Callable(this, LW_NAME(emit_signal)).bind(LW_NAME(Close)));
|
||||||
close_button->set_shortcut(LW_GET_SHORTCUT("limbo_ai/hide_tree_search")); // TODO: use internal shortcut. also sets tooltip...
|
close_button->set_shortcut(LW_GET_SHORTCUT("limbo_ai/hide_tree_search")); // TODO: use internal shortcut.
|
||||||
// Search callbacks
|
// Search callbacks
|
||||||
Callable c_update_requested = Callable(this, LW_NAME(emit_signal)).bind("update_requested");
|
Callable c_update_requested = Callable(this, LW_NAME(emit_signal)).bind("update_requested");
|
||||||
Callable c_text_submitted = Callable(this, LW_NAME(emit_signal)).bind(LW_NAME(text_submitted));
|
Callable c_text_submitted = Callable(this, LW_NAME(emit_signal)).bind(LW_NAME(text_submitted));
|
||||||
|
|
Loading…
Reference in New Issue