From d67b602f2f995f0044b446646619adf45d37256d Mon Sep 17 00:00:00 2001 From: Dmitry Koteroff Date: Mon, 20 Nov 2017 21:25:13 +0300 Subject: Add "New Folder.." to right mouse button click on project fileslist panel _WHEN_ no any file/folder is under mouse cursor. --- scene/gui/item_list.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'scene/gui') diff --git a/scene/gui/item_list.cpp b/scene/gui/item_list.cpp index e9e9dcc859..5e4dedcb48 100644 --- a/scene/gui/item_list.cpp +++ b/scene/gui/item_list.cpp @@ -523,6 +523,11 @@ void ItemList::_gui_input(const Ref &p_event) { } } + return; + } + if (mb->get_button_index() == BUTTON_RIGHT) { + emit_signal("rmb_clicked", mb->get_position()); + return; } } @@ -1397,6 +1402,7 @@ void ItemList::_bind_methods() { ADD_SIGNAL(MethodInfo("item_rmb_selected", PropertyInfo(Variant::INT, "index"), PropertyInfo(Variant::VECTOR2, "at_position"))); ADD_SIGNAL(MethodInfo("multi_selected", PropertyInfo(Variant::INT, "index"), PropertyInfo(Variant::BOOL, "selected"))); ADD_SIGNAL(MethodInfo("item_activated", PropertyInfo(Variant::INT, "index"))); + ADD_SIGNAL(MethodInfo("rmb_clicked", PropertyInfo(Variant::VECTOR2, "at_position"))); GLOBAL_DEF("gui/timers/incremental_search_max_interval_msec", 2000); } -- cgit v1.2.3