Tree - fix ui_select

This commit is contained in:
havi05 2025-01-20 17:23:26 +01:00
parent 791c87eb7a
commit 522d6fed70

View file

@ -3680,15 +3680,6 @@ void Tree::gui_input(const Ref<InputEvent> &p_event) {
prev->select(selected_col); prev->select(selected_col);
} }
ensure_cursor_is_visible(); ensure_cursor_is_visible();
} else if (p_event->is_action("ui_accept") && p_event->is_pressed()) {
if (selected_item) {
//bring up editor if possible
if (!edit_selected()) {
emit_signal(SNAME("item_activated"));
incr_search.clear();
}
}
accept_event();
} else if (p_event->is_action("ui_select") && p_event->is_pressed()) { } else if (p_event->is_action("ui_select") && p_event->is_pressed()) {
if (select_mode == SELECT_MULTI) { if (select_mode == SELECT_MULTI) {
if (!selected_item) { if (!selected_item) {
@ -3703,6 +3694,15 @@ void Tree::gui_input(const Ref<InputEvent> &p_event) {
} }
} }
accept_event(); accept_event();
} else if (p_event->is_action("ui_accept") && p_event->is_pressed()) {
if (selected_item) {
//bring up editor if possible
if (!edit_selected()) {
emit_signal(SNAME("item_activated"));
incr_search.clear();
}
}
accept_event();
} }
if (allow_search && k.is_valid()) { // Incremental search if (allow_search && k.is_valid()) { // Incremental search