From 89bb72b2d3ae209eae64252fcbac7d6f0ff6e376 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Thu, 30 Jun 2016 17:51:45 -0300 Subject: [PATCH] Only emit item_selected once per Tree row, closes #5280 --- scene/gui/tree.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index f8516f8f5d1..db14c15db84 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -1355,6 +1355,8 @@ void Tree::select_single_item(TreeItem *p_selected,TreeItem *p_current,int p_col switched=true; } + bool emitted_row=false; + for (int i=0;icells[i]; @@ -1373,7 +1375,10 @@ void Tree::select_single_item(TreeItem *p_selected,TreeItem *p_current,int p_col selected_item=p_selected; selected_col=0; selected_item=p_selected; - emit_signal("item_selected"); + if (!emitted_row) { + emit_signal("item_selected"); + emitted_row=true; + } //if (p_col==i) // p_current->selected_signal.call(p_col); }