summaryrefslogtreecommitdiff
path: root/scene/gui
diff options
context:
space:
mode:
authorkleonc <9283098+kleonc@users.noreply.github.com>2021-12-10 16:54:47 +0100
committerkleonc <9283098+kleonc@users.noreply.github.com>2021-12-10 16:54:47 +0100
commit67dd4f15ee8fe44d9388c781bf9688f39afc4740 (patch)
treed92d87dca888f8d23fa20106199b7595179759ca /scene/gui
parentf675b6b6237696788df1ad9c1f2d9f3d2b025352 (diff)
Tree Don't consume mouse event by collapse arrow which isn't shown
Diffstat (limited to 'scene/gui')
-rw-r--r--scene/gui/tree.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp
index 5a6ac7c0d2..706f8b0161 100644
--- a/scene/gui/tree.cpp
+++ b/scene/gui/tree.cpp
@@ -2316,12 +2316,9 @@ int Tree::propagate_mouse_event(const Point2i &p_pos, int x_ofs, int y_ofs, int
return -1;
}
- if (!p_item->disable_folding && !hide_folding && (p_pos.x >= x_ofs && p_pos.x < (x_ofs + cache.item_margin))) {
- if (p_item->first_child) {
- p_item->set_collapsed(!p_item->is_collapsed());
- }
-
- return -1; //handled!
+ if (!p_item->disable_folding && !hide_folding && p_item->first_child && (p_pos.x >= x_ofs && p_pos.x < (x_ofs + cache.item_margin))) {
+ p_item->set_collapsed(!p_item->is_collapsed());
+ return -1;
}
int x = p_pos.x;