From 307427af89d4cbbcf32099f6009739f50c8bd0a0 Mon Sep 17 00:00:00 2001 From: trollodel <33117082+trollodel@users.noreply.github.com> Date: Sat, 18 Sep 2021 09:33:18 +0200 Subject: Add the button pressed to some signals in Tree --- editor/filesystem_dock.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'editor/filesystem_dock.cpp') diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp index 8a995eaa8f..aaff892c2a 100644 --- a/editor/filesystem_dock.cpp +++ b/editor/filesystem_dock.cpp @@ -2592,7 +2592,10 @@ void FileSystemDock::_file_and_folders_fill_popup(PopupMenu *p_popup, Vector paths = _tree_get_selected(false); @@ -2615,7 +2618,10 @@ void FileSystemDock::_tree_rmb_select(const Vector2 &p_pos) { } } -void FileSystemDock::_tree_rmb_empty(const Vector2 &p_pos) { +void FileSystemDock::_tree_empty_click(const Vector2 &p_pos, MouseButton p_button) { + if (p_button != MouseButton::RIGHT) { + return; + } // Right click is pressed in the empty space of the tree. path = "res://"; tree_popup->clear(); @@ -3106,8 +3112,8 @@ FileSystemDock::FileSystemDock() { tree->connect("item_activated", callable_mp(this, &FileSystemDock::_tree_activate_file)); tree->connect("multi_selected", callable_mp(this, &FileSystemDock::_tree_multi_selected)); - tree->connect("item_rmb_selected", callable_mp(this, &FileSystemDock::_tree_rmb_select)); - tree->connect("empty_rmb", callable_mp(this, &FileSystemDock::_tree_rmb_empty)); + tree->connect("item_mouse_selected", callable_mp(this, &FileSystemDock::_tree_rmb_select)); + tree->connect("empty_clicked", callable_mp(this, &FileSystemDock::_tree_empty_click)); tree->connect("nothing_selected", callable_mp(this, &FileSystemDock::_tree_empty_selected)); tree->connect("gui_input", callable_mp(this, &FileSystemDock::_tree_gui_input)); tree->connect("mouse_exited", callable_mp(this, &FileSystemDock::_tree_mouse_exited)); -- cgit v1.2.3