@@ -223,12 +223,8 @@ void ConnectDialog::_add_bind() {
223223/*
224224 * Remove parameter bind from connection.
225225 */
226- void ConnectDialog::_remove_bind () {
227- String st = bind_editor->get_selected_path ();
228- if (st.is_empty ()) {
229- return ;
230- }
231- int idx = st.get_slicec (' /' , 1 ).to_int () - 1 ;
226+ void ConnectDialog::_remove_bind (const String &p_bind) {
227+ int idx = p_bind.get_slicec (' /' , 1 ).to_int () - 1 ;
232228
233229 ERR_FAIL_INDEX (idx, cdbinds->params .size ());
234230 cdbinds->params .remove_at (idx);
@@ -855,17 +851,13 @@ ConnectDialog::ConnectDialog() {
855851 add_bind->connect (SceneStringName (pressed), callable_mp (this , &ConnectDialog::_add_bind));
856852 bind_controls.push_back (add_bind);
857853
858- Button *del_bind = memnew (Button);
859- del_bind->set_text (TTR (" Remove" ));
860- add_bind_hb->add_child (del_bind);
861- del_bind->connect (SceneStringName (pressed), callable_mp (this , &ConnectDialog::_remove_bind));
862- bind_controls.push_back (del_bind);
863-
864854 vbc_right->add_margin_child (TTR (" Add Extra Call Argument:" ), add_bind_hb);
865855
866856 bind_editor = memnew (EditorInspector);
867857 bind_editor->set_accessibility_name (TTRC (" Extra Call Arguments:" ));
858+ bind_editor->set_use_deletable_properties (true );
868859 bind_controls.push_back (bind_editor);
860+ bind_editor->connect (" property_deleted" , callable_mp (this , &ConnectDialog::_remove_bind));
869861
870862 vbc_right->add_margin_child (TTR (" Extra Call Arguments:" ), bind_editor, true );
871863
0 commit comments