Grabbing focus on ProjectList after clicking an item.

Fixes: #39012
(cherry picked from commit 1ec8f59397)
This commit is contained in:
Dominik 'dreamsComeTrue' Jasiński 2020-05-29 20:21:15 +02:00 committed by Rémi Verschelde
parent 9753181956
commit 982ab51f2f
1 changed files with 6 additions and 0 deletions

View File

@ -945,6 +945,8 @@ public:
icon = NULL; icon = NULL;
icon_needs_reload = true; icon_needs_reload = true;
hover = false; hover = false;
set_focus_mode(FocusMode::FOCUS_ALL);
} }
void set_is_favorite(bool fav) { void set_is_favorite(bool fav) {
@ -1728,6 +1730,10 @@ void ProjectList::_panel_input(const Ref<InputEvent> &p_ev, Node *p_hb) {
select_project(clicked_index); select_project(clicked_index);
} }
if (_selected_project_keys.has(clicked_project.project_key)) {
clicked_project.control->grab_focus();
}
emit_signal(SIGNAL_SELECTION_CHANGED); emit_signal(SIGNAL_SELECTION_CHANGED);
if (!mb->get_control() && mb->is_doubleclick()) { if (!mb->get_control() && mb->is_doubleclick()) {