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/dependency_editor.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'editor/dependency_editor.cpp') diff --git a/editor/dependency_editor.cpp b/editor/dependency_editor.cpp index 5b5e0203a3..7b73a392b4 100644 --- a/editor/dependency_editor.cpp +++ b/editor/dependency_editor.cpp @@ -49,7 +49,10 @@ void DependencyEditor::_searched(const String &p_path) { _update_file(); } -void DependencyEditor::_load_pressed(Object *p_item, int p_cell, int p_button) { +void DependencyEditor::_load_pressed(Object *p_item, int p_cell, int p_button, MouseButton p_mouse_button) { + if (p_mouse_button != MouseButton::LEFT) { + return; + } TreeItem *ti = Object::cast_to(p_item); replacing = ti->get_text(1); @@ -242,7 +245,7 @@ DependencyEditor::DependencyEditor() { tree->set_column_clip_content(1, true); tree->set_column_expand_ratio(1, 1); tree->set_hide_root(true); - tree->connect("button_pressed", callable_mp(this, &DependencyEditor::_load_pressed)); + tree->connect("button_clicked", callable_mp(this, &DependencyEditor::_load_pressed)); HBoxContainer *hbc = memnew(HBoxContainer); Label *label = memnew(Label(TTR("Dependencies:"))); @@ -761,7 +764,10 @@ void OrphanResourcesDialog::_delete_confirm() { refresh(); } -void OrphanResourcesDialog::_button_pressed(Object *p_item, int p_column, int p_id) { +void OrphanResourcesDialog::_button_pressed(Object *p_item, int p_column, int p_id, MouseButton p_button) { + if (p_button != MouseButton::LEFT) { + return; + } TreeItem *ti = Object::cast_to(p_item); String path = ti->get_metadata(0); @@ -796,5 +802,5 @@ OrphanResourcesDialog::OrphanResourcesDialog() { files->set_column_title(1, TTR("Owns")); files->set_hide_root(true); vbc->add_margin_child(TTR("Resources Without Explicit Ownership:"), files, true); - files->connect("button_pressed", callable_mp(this, &OrphanResourcesDialog::_button_pressed)); + files->connect("button_clicked", callable_mp(this, &OrphanResourcesDialog::_button_pressed)); } -- cgit v1.2.3