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/editor_autoload_settings.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'editor/editor_autoload_settings.cpp') diff --git a/editor/editor_autoload_settings.cpp b/editor/editor_autoload_settings.cpp index 4c73e36269..ee4955d0a0 100644 --- a/editor/editor_autoload_settings.cpp +++ b/editor/editor_autoload_settings.cpp @@ -280,7 +280,10 @@ void EditorAutoloadSettings::_autoload_edited() { updating_autoload = false; } -void EditorAutoloadSettings::_autoload_button_pressed(Object *p_item, int p_column, int p_button) { +void EditorAutoloadSettings::_autoload_button_pressed(Object *p_item, int p_column, int p_button, MouseButton p_mouse_button) { + if (p_mouse_button != MouseButton::LEFT) { + return; + } TreeItem *ti = Object::cast_to(p_item); String name = "autoload/" + ti->get_text(0); @@ -950,7 +953,7 @@ EditorAutoloadSettings::EditorAutoloadSettings() { tree->connect("cell_selected", callable_mp(this, &EditorAutoloadSettings::_autoload_selected)); tree->connect("item_edited", callable_mp(this, &EditorAutoloadSettings::_autoload_edited)); - tree->connect("button_pressed", callable_mp(this, &EditorAutoloadSettings::_autoload_button_pressed)); + tree->connect("button_clicked", callable_mp(this, &EditorAutoloadSettings::_autoload_button_pressed)); tree->connect("item_activated", callable_mp(this, &EditorAutoloadSettings::_autoload_activated)); tree->set_v_size_flags(SIZE_EXPAND_FILL); -- cgit v1.2.3