From 8d48cf95b9408a0a54bb741c6b795d2e5179503d Mon Sep 17 00:00:00 2001 From: Franklin Sobrinho Date: Thu, 5 Nov 2015 12:20:45 -0300 Subject: Add Tree checkbox check/uncheck behavior when pressing enter --- scene/gui/tree.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index 5df6f2ced9..9789c83806 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -2266,9 +2266,12 @@ bool Tree::edit_selected() { TreeItem::Cell &c = s->cells[col]; + if (c.mode==TreeItem::CELL_MODE_CHECK) { - - if (c.mode==TreeItem::CELL_MODE_CUSTOM) { + s->set_checked(col, !c.checked); + item_edited(col,s); + return true; + } else if (c.mode==TreeItem::CELL_MODE_CUSTOM) { edited_item=s; edited_col=col; -- cgit v1.2.3