mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
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 def41b9856)
This commit is contained in:
parent
e06fa5a089
commit
4a1c9de869
1 changed files with 2 additions and 0 deletions
|
|
@ -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
|
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");
|
emit_signal("item_activated");
|
||||||
|
incr_search.clear();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2037,6 +2038,7 @@ void Tree::_input_event(InputEvent p_event) {
|
||||||
//bring up editor if possible
|
//bring up editor if possible
|
||||||
if (!edit_selected()) {
|
if (!edit_selected()) {
|
||||||
emit_signal("item_activated");
|
emit_signal("item_activated");
|
||||||
|
incr_search.clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
accept_event();
|
accept_event();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue