|
@@ -3394,7 +3394,7 @@ void Tree::gui_input(const Ref<InputEvent> &p_event) {
|
|
Ref<InputEventKey> k = p_event;
|
|
Ref<InputEventKey> k = p_event;
|
|
|
|
|
|
bool is_command = k.is_valid() && k->is_command_or_control_pressed();
|
|
bool is_command = k.is_valid() && k->is_command_or_control_pressed();
|
|
- if (p_event->is_action("ui_right", true) && p_event->is_pressed()) {
|
|
|
|
|
|
+ if (p_event->is_action("ui_right") && p_event->is_pressed()) {
|
|
if (!cursor_can_exit_tree) {
|
|
if (!cursor_can_exit_tree) {
|
|
accept_event();
|
|
accept_event();
|
|
}
|
|
}
|
|
@@ -3402,17 +3402,12 @@ void Tree::gui_input(const Ref<InputEvent> &p_event) {
|
|
if (!selected_item || select_mode == SELECT_ROW || selected_col > (columns.size() - 1)) {
|
|
if (!selected_item || select_mode == SELECT_ROW || selected_col > (columns.size() - 1)) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- if (k.is_valid() && k->is_alt_pressed()) {
|
|
|
|
- selected_item->set_collapsed(false);
|
|
|
|
- TreeItem *next = selected_item->get_first_child();
|
|
|
|
- while (next && next != selected_item->next) {
|
|
|
|
- next->set_collapsed(false);
|
|
|
|
- next = next->get_next_visible();
|
|
|
|
- }
|
|
|
|
|
|
+ if (k.is_valid() && k->is_shift_pressed()) {
|
|
|
|
+ selected_item->set_collapsed_recursive(false);
|
|
} else {
|
|
} else {
|
|
_go_right();
|
|
_go_right();
|
|
}
|
|
}
|
|
- } else if (p_event->is_action("ui_left", true) && p_event->is_pressed()) {
|
|
|
|
|
|
+ } else if (p_event->is_action("ui_left") && p_event->is_pressed()) {
|
|
if (!cursor_can_exit_tree) {
|
|
if (!cursor_can_exit_tree) {
|
|
accept_event();
|
|
accept_event();
|
|
}
|
|
}
|
|
@@ -3421,32 +3416,27 @@ void Tree::gui_input(const Ref<InputEvent> &p_event) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
- if (k.is_valid() && k->is_alt_pressed()) {
|
|
|
|
- selected_item->set_collapsed(true);
|
|
|
|
- TreeItem *next = selected_item->get_first_child();
|
|
|
|
- while (next && next != selected_item->next) {
|
|
|
|
- next->set_collapsed(true);
|
|
|
|
- next = next->get_next_visible();
|
|
|
|
- }
|
|
|
|
|
|
+ if (k.is_valid() && k->is_shift_pressed()) {
|
|
|
|
+ selected_item->set_collapsed_recursive(true);
|
|
} else {
|
|
} else {
|
|
_go_left();
|
|
_go_left();
|
|
}
|
|
}
|
|
|
|
|
|
- } else if (p_event->is_action("ui_up", true) && p_event->is_pressed() && !is_command) {
|
|
|
|
|
|
+ } else if (p_event->is_action("ui_up") && p_event->is_pressed() && !is_command) {
|
|
if (!cursor_can_exit_tree) {
|
|
if (!cursor_can_exit_tree) {
|
|
accept_event();
|
|
accept_event();
|
|
}
|
|
}
|
|
|
|
|
|
_go_up();
|
|
_go_up();
|
|
|
|
|
|
- } else if (p_event->is_action("ui_down", true) && p_event->is_pressed() && !is_command) {
|
|
|
|
|
|
+ } else if (p_event->is_action("ui_down") && p_event->is_pressed() && !is_command) {
|
|
if (!cursor_can_exit_tree) {
|
|
if (!cursor_can_exit_tree) {
|
|
accept_event();
|
|
accept_event();
|
|
}
|
|
}
|
|
|
|
|
|
_go_down();
|
|
_go_down();
|
|
|
|
|
|
- } else if (p_event->is_action("ui_page_down", true) && p_event->is_pressed()) {
|
|
|
|
|
|
+ } else if (p_event->is_action("ui_page_down") && p_event->is_pressed()) {
|
|
if (!cursor_can_exit_tree) {
|
|
if (!cursor_can_exit_tree) {
|
|
accept_event();
|
|
accept_event();
|
|
}
|
|
}
|
|
@@ -3484,7 +3474,7 @@ void Tree::gui_input(const Ref<InputEvent> &p_event) {
|
|
}
|
|
}
|
|
|
|
|
|
ensure_cursor_is_visible();
|
|
ensure_cursor_is_visible();
|
|
- } else if (p_event->is_action("ui_page_up", true) && p_event->is_pressed()) {
|
|
|
|
|
|
+ } else if (p_event->is_action("ui_page_up") && p_event->is_pressed()) {
|
|
if (!cursor_can_exit_tree) {
|
|
if (!cursor_can_exit_tree) {
|
|
accept_event();
|
|
accept_event();
|
|
}
|
|
}
|
|
@@ -3521,7 +3511,7 @@ 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", true) && p_event->is_pressed()) {
|
|
|
|
|
|
+ } else if (p_event->is_action("ui_accept") && p_event->is_pressed()) {
|
|
if (selected_item) {
|
|
if (selected_item) {
|
|
//bring up editor if possible
|
|
//bring up editor if possible
|
|
if (!edit_selected()) {
|
|
if (!edit_selected()) {
|
|
@@ -3530,7 +3520,7 @@ void Tree::gui_input(const Ref<InputEvent> &p_event) {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
accept_event();
|
|
accept_event();
|
|
- } else if (p_event->is_action("ui_select", true) && 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) {
|
|
return;
|
|
return;
|