浏览代码

Disable disconnect button for inherited signals

Saracen 2 年之前
父节点
当前提交
054934fde3
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      editor/connections_dialog.cpp

+ 3 - 1
editor/connections_dialog.cpp

@@ -1026,7 +1026,9 @@ void ConnectionsDock::_tree_item_selected() {
 	} else if (item && _get_item_type(*item) == TREE_ITEM_TYPE_CONNECTION) {
 	} else if (item && _get_item_type(*item) == TREE_ITEM_TYPE_CONNECTION) {
 		connect_button->set_text(TTR("Disconnect"));
 		connect_button->set_text(TTR("Disconnect"));
 		connect_button->set_icon(get_editor_theme_icon(SNAME("Unlinked")));
 		connect_button->set_icon(get_editor_theme_icon(SNAME("Unlinked")));
-		connect_button->set_disabled(false);
+
+		Object::Connection connection = item->get_metadata(0);
+		connect_button->set_disabled(_is_connection_inherited(connection));
 	} else {
 	} else {
 		connect_button->set_text(TTR("Connect..."));
 		connect_button->set_text(TTR("Connect..."));
 		connect_button->set_icon(get_editor_theme_icon(SNAME("Instance")));
 		connect_button->set_icon(get_editor_theme_icon(SNAME("Instance")));