aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Haas2017-05-04 22:01:26 +0200
committerRémi Verschelde2017-05-26 23:45:11 +0200
commit4a1c9de869402f71d119ced5110b135ad5dff7ba (patch)
tree3a335ce8792921537f9de7f05809b744d0d53348
parente06fa5a0891aeb716e89806969d3d9def020ce78 (diff)
downloadgodot-4a1c9de869402f71d119ced5110b135ad5dff7ba.tar.gz
godot-4a1c9de869402f71d119ced5110b135ad5dff7ba.tar.zst
godot-4a1c9de869402f71d119ced5110b135ad5dff7ba.zip
Tree: Clear search string on selection.
The Tree node has the ability to jump to a specific item by typing the first few chars of it's name. But on selection ('item_activated' signal), it didn't clear the search string used for that. It was especially annoying in `FileDialog`s and has been bugging me for ages :P With this, you can traverse a directory structure in a FileDiag quickly with the keyboard (like you'd expect from pretty much any modern file browser) :) (cherry picked from commit def41b985685a50385541d116ab62407bbd95c60)
-rw-r--r--scene/gui/tree.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp
index 99ac47d34..60d018197 100644
--- a/scene/gui/tree.cpp
+++ b/scene/gui/tree.cpp
@@ -1489,6 +1489,7 @@ int Tree::propagate_mouse_event(const Point2i &p_pos, int x_ofs, int y_ofs, bool
if (p_doubleclick && (!c.editable || c.mode == TreeItem::CELL_MODE_CUSTOM || c.mode == TreeItem::CELL_MODE_ICON /*|| c.mode==TreeItem::CELL_MODE_CHECK*/)) { //it' s confusing for check
emit_signal("item_activated");
+ incr_search.clear();
return -1;
}
@@ -2037,6 +2038,7 @@ void Tree::_input_event(InputEvent p_event) {
//bring up editor if possible
if (!edit_selected()) {
emit_signal("item_activated");
+ incr_search.clear();
}
}
accept_event();