From d8ac5cff579bb454b945eaf6c47f4240fb431570 Mon Sep 17 00:00:00 2001 From: Zher Huei Lee Date: Sun, 28 Feb 2016 19:58:17 +0000 Subject: Adds EditorPlugin::remove_control_from_bottom_panel() Also renames `add_control_to_bottom_dock` to `add_control_to_bottom_panel` so that it would be clear that the removal functions are different too. --- tools/editor/editor_node.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'tools/editor/editor_node.cpp') diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp index 4666a4965..c10f1e97f 100644 --- a/tools/editor/editor_node.cpp +++ b/tools/editor/editor_node.cpp @@ -4810,6 +4810,28 @@ void EditorNode::raise_bottom_panel_item(Control *p_item) { } +void EditorNode::remove_bottom_panel_item(Control *p_item) { + + for(int i=0;iis_visible()) { + _bottom_panel_switch(false,0); + } + bottom_panel_vb->remove_child(bottom_panel_items[i].control); + bottom_panel_hb->remove_child(bottom_panel_items[i].button); + memdelete( bottom_panel_items[i].button ); + bottom_panel_items.remove(i); + break; + } + } + + for(int i=0;idisconnect("toggled",this,"_bottom_panel_switch"); + bottom_panel_items[i].button->connect("toggled",this,"_bottom_panel_switch",varray(i)); + } +} + void EditorNode::_bottom_panel_switch(bool p_enable,int p_idx) { ERR_FAIL_INDEX(p_idx,bottom_panel_items.size()); -- cgit v1.2.3-70-g09d2