summaryrefslogtreecommitdiff
path: root/editor/debugger
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-05-24 10:50:55 +0200
committerGitHub <noreply@github.com>2022-05-24 10:50:55 +0200
commit65dd1bf02392adf777ffd1891c8232615cf57a1d (patch)
tree732e32fb7a991c0e3f5d97ee666e68a3f4c72c01 /editor/debugger
parent56dbfcdcbadf2c958d9656e4e3b7443b9bb11be1 (diff)
parent307427af89d4cbbcf32099f6009739f50c8bd0a0 (diff)
Merge pull request #47665 from trollodel/tree_more_buttons_signals
Diffstat (limited to 'editor/debugger')
-rw-r--r--editor/debugger/editor_debugger_tree.cpp8
-rw-r--r--editor/debugger/editor_debugger_tree.h2
-rw-r--r--editor/debugger/script_editor_debugger.cpp16
-rw-r--r--editor/debugger/script_editor_debugger.h4
4 files changed, 21 insertions, 9 deletions
diff --git a/editor/debugger/editor_debugger_tree.cpp b/editor/debugger/editor_debugger_tree.cpp
index 3a65d015d5..023204b74a 100644
--- a/editor/debugger/editor_debugger_tree.cpp
+++ b/editor/debugger/editor_debugger_tree.cpp
@@ -57,7 +57,7 @@ void EditorDebuggerTree::_notification(int p_what) {
case NOTIFICATION_POSTINITIALIZE: {
connect("cell_selected", callable_mp(this, &EditorDebuggerTree::_scene_tree_selected));
connect("item_collapsed", callable_mp(this, &EditorDebuggerTree::_scene_tree_folded));
- connect("item_rmb_selected", callable_mp(this, &EditorDebuggerTree::_scene_tree_rmb_selected));
+ connect("item_mouse_selected", callable_mp(this, &EditorDebuggerTree::_scene_tree_rmb_selected));
} break;
}
}
@@ -100,7 +100,11 @@ void EditorDebuggerTree::_scene_tree_folded(Object *p_obj) {
}
}
-void EditorDebuggerTree::_scene_tree_rmb_selected(const Vector2 &p_position) {
+void EditorDebuggerTree::_scene_tree_rmb_selected(const Vector2 &p_position, MouseButton p_button) {
+ if (p_button != MouseButton::RIGHT) {
+ return;
+ }
+
TreeItem *item = get_item_at_position(p_position);
if (!item) {
return;
diff --git a/editor/debugger/editor_debugger_tree.h b/editor/debugger/editor_debugger_tree.h
index 4e38f00ffa..bba524039e 100644
--- a/editor/debugger/editor_debugger_tree.h
+++ b/editor/debugger/editor_debugger_tree.h
@@ -56,7 +56,7 @@ private:
String _get_path(TreeItem *p_item);
void _scene_tree_folded(Object *p_obj);
void _scene_tree_selected();
- void _scene_tree_rmb_selected(const Vector2 &p_position);
+ void _scene_tree_rmb_selected(const Vector2 &p_position, MouseButton p_button);
void _item_menu_id_pressed(int p_option);
void _file_selected(const String &p_file);
diff --git a/editor/debugger/script_editor_debugger.cpp b/editor/debugger/script_editor_debugger.cpp
index 44a7aade09..60486b5286 100644
--- a/editor/debugger/script_editor_debugger.cpp
+++ b/editor/debugger/script_editor_debugger.cpp
@@ -1472,7 +1472,11 @@ void ScriptEditorDebugger::_clear_errors_list() {
clear_button->set_disabled(true);
}
-void ScriptEditorDebugger::_breakpoints_item_rmb_selected(const Vector2 &p_pos) {
+void ScriptEditorDebugger::_breakpoints_item_rmb_selected(const Vector2 &p_pos, MouseButton p_button) {
+ if (p_button != MouseButton::RIGHT) {
+ return;
+ }
+
breakpoints_menu->clear();
breakpoints_menu->set_size(Size2(1, 1));
@@ -1490,7 +1494,11 @@ void ScriptEditorDebugger::_breakpoints_item_rmb_selected(const Vector2 &p_pos)
}
// Right click on specific file(s) or folder(s).
-void ScriptEditorDebugger::_error_tree_item_rmb_selected(const Vector2 &p_pos) {
+void ScriptEditorDebugger::_error_tree_item_rmb_selected(const Vector2 &p_pos, MouseButton p_button) {
+ if (p_button != MouseButton::RIGHT) {
+ return;
+ }
+
item_menu->clear();
item_menu->reset_size();
@@ -1780,7 +1788,7 @@ ScriptEditorDebugger::ScriptEditorDebugger() {
breakpoints_tree->set_allow_reselect(true);
breakpoints_tree->set_allow_rmb_select(true);
breakpoints_tree->set_hide_root(true);
- breakpoints_tree->connect("item_rmb_selected", callable_mp(this, &ScriptEditorDebugger::_breakpoints_item_rmb_selected));
+ breakpoints_tree->connect("item_mouse_selected", callable_mp(this, &ScriptEditorDebugger::_breakpoints_item_rmb_selected));
breakpoints_tree->create_item();
parent_sc->add_child(breakpoints_tree);
@@ -1835,7 +1843,7 @@ ScriptEditorDebugger::ScriptEditorDebugger() {
error_tree->set_hide_root(true);
error_tree->set_v_size_flags(SIZE_EXPAND_FILL);
error_tree->set_allow_rmb_select(true);
- error_tree->connect("item_rmb_selected", callable_mp(this, &ScriptEditorDebugger::_error_tree_item_rmb_selected));
+ error_tree->connect("item_mouse_selected", callable_mp(this, &ScriptEditorDebugger::_error_tree_item_rmb_selected));
errors_tab->add_child(error_tree);
item_menu = memnew(PopupMenu);
diff --git a/editor/debugger/script_editor_debugger.h b/editor/debugger/script_editor_debugger.h
index d445fe48d1..aa0a50ff03 100644
--- a/editor/debugger/script_editor_debugger.h
+++ b/editor/debugger/script_editor_debugger.h
@@ -201,8 +201,8 @@ private:
void _clear_errors_list();
- void _breakpoints_item_rmb_selected(const Vector2 &p_pos);
- void _error_tree_item_rmb_selected(const Vector2 &p_pos);
+ void _breakpoints_item_rmb_selected(const Vector2 &p_pos, MouseButton p_button);
+ void _error_tree_item_rmb_selected(const Vector2 &p_pos, MouseButton p_button);
void _item_menu_id_pressed(int p_option);
void _tab_changed(int p_tab);