aboutsummaryrefslogtreecommitdiff
path: root/tools/editor/editor_node.cpp
diff options
context:
space:
mode:
authorJuan Linietsky2016-02-28 23:11:37 -0300
committerJuan Linietsky2016-02-28 23:11:37 -0300
commit640443be6a81c2b5a0f7182bf51b6196fbfc6215 (patch)
treef772a9dd55d23bffd0034b2dc2398df9f6aa319f /tools/editor/editor_node.cpp
parent96b60c281fcaee977b1116dfa0ca8c3064fefa36 (diff)
parent3546403af2a95e6d209ce1113e78bef7bfb9440b (diff)
downloadgodot-640443be6a81c2b5a0f7182bf51b6196fbfc6215.tar.gz
godot-640443be6a81c2b5a0f7182bf51b6196fbfc6215.tar.zst
godot-640443be6a81c2b5a0f7182bf51b6196fbfc6215.zip
Merge pull request #3864 from leezh/editorplugin_extras
Adds EditorPlugin::remove_control_from_bottom_panel()
Diffstat (limited to '')
-rw-r--r--tools/editor/editor_node.cpp22
1 files changed, 22 insertions, 0 deletions
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;i<bottom_panel_items.size();i++) {
+
+ if (bottom_panel_items[i].control==p_item) {
+ if (p_item->is_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;i<bottom_panel_items.size();i++) {
+ bottom_panel_items[i].button->disconnect("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());