summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2017-08-27 02:09:10 +0200
committerGitHub <noreply@github.com>2017-08-27 02:09:10 +0200
commit0fc2b3aa6978fc1f49331c261620b3da08259623 (patch)
treed86bd137a78ed75e124a98b1c198e74c8aa5421f /scene
parent00f0884eacfebffa2df788ab9d923a50580eaff7 (diff)
parent5e889cce4f113410431278cd00aaea8c6c7366a3 (diff)
Merge pull request #10660 from Noshyaar/pr-tree
Tree: fix RMB click collapses next item
Diffstat (limited to 'scene')
-rw-r--r--scene/gui/tree.cpp28
1 files changed, 15 insertions, 13 deletions
diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp
index 20bf818d44..38cd425a89 100644
--- a/scene/gui/tree.cpp
+++ b/scene/gui/tree.cpp
@@ -2473,22 +2473,24 @@ void Tree::_gui_input(Ref<InputEvent> p_event) {
Point2 pos = b->get_position() - bg->get_offset();
cache.click_type = Cache::CLICK_NONE;
- if (show_column_titles && b->get_button_index() == BUTTON_LEFT) {
+ if (show_column_titles) {
pos.y -= _get_title_button_height();
if (pos.y < 0) {
- pos.x += cache.offset.x;
- int len = 0;
- for (int i = 0; i < columns.size(); i++) {
-
- len += get_column_width(i);
- if (pos.x < len) {
-
- cache.click_type = Cache::CLICK_TITLE;
- cache.click_index = i;
- //cache.click_id=;
- update();
- break;
+ if (b->get_button_index() == BUTTON_LEFT) {
+ pos.x += cache.offset.x;
+ int len = 0;
+ for (int i = 0; i < columns.size(); i++) {
+
+ len += get_column_width(i);
+ if (pos.x < len) {
+
+ cache.click_type = Cache::CLICK_TITLE;
+ cache.click_index = i;
+ //cache.click_id=;
+ update();
+ break;
+ }
}
}
break;