diff options
author | Juan Linietsky <reduzio@gmail.com> | 2016-05-16 12:23:40 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2016-05-16 12:23:58 -0300 |
commit | f9d615ee87ac27fa5fa26f91738b5267ecc7b40e (patch) | |
tree | 4842626ad9125e21632be7a884e18e72ae70d53f /scene/gui | |
parent | 6cf4f20590c850cf70da0c46101c6545f028be43 (diff) |
Contextualized Scene Tree menu
-Added context menu to Scene Tree Dock
-Removed Buttons
-Added a filter to search for nods more easily in the dock
Diffstat (limited to 'scene/gui')
-rw-r--r-- | scene/gui/tree.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index 9c70785408..2c39aea08c 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -2389,8 +2389,12 @@ void Tree::_input_event(InputEvent p_event) { } } - if (!root) + if (!root || (!root->get_children() && hide_root)) { + if (b.button_index==BUTTON_RIGHT && allow_rmb_select) { + emit_signal("empty_tree_rmb_selected",get_local_mouse_pos()); + } break; + } click_handled=false; pressing_for_editor=false; @@ -3551,9 +3555,10 @@ void Tree::_bind_methods() { ObjectTypeDB::bind_method(_MD("get_single_select_cell_editing_only_when_already_selected"),&Tree::get_single_select_cell_editing_only_when_already_selected); ADD_SIGNAL( MethodInfo("item_selected")); - ADD_SIGNAL( MethodInfo("item_rmb_selected",PropertyInfo(Variant::VECTOR2,"pos"))); ADD_SIGNAL( MethodInfo("cell_selected")); ADD_SIGNAL( MethodInfo("multi_selected",PropertyInfo(Variant::OBJECT,"item"),PropertyInfo(Variant::INT,"column"),PropertyInfo(Variant::BOOL,"selected")) ); + ADD_SIGNAL( MethodInfo("item_rmb_selected",PropertyInfo(Variant::VECTOR2,"pos"))); + ADD_SIGNAL( MethodInfo("empty_tree_rmb_selected",PropertyInfo(Variant::VECTOR2,"pos"))); ADD_SIGNAL( MethodInfo("item_edited")); ADD_SIGNAL( MethodInfo("item_collapsed",PropertyInfo(Variant::OBJECT,"item"))); //ADD_SIGNAL( MethodInfo("item_doubleclicked" ) ); |