summaryrefslogtreecommitdiff
path: root/editor/editor_node.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/editor_node.cpp')
-rw-r--r--editor/editor_node.cpp27
1 files changed, 17 insertions, 10 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index 1e03adc219..6140412a32 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -136,10 +136,10 @@ void EditorNode::_update_scene_tabs() {
Ref<Texture> script_icon = gui_base->get_icon("Script", "EditorIcons");
for (int i = 0; i < editor_data.get_edited_scene_count(); i++) {
- String type = editor_data.get_scene_type(i);
+ Node *type_node = editor_data.get_edited_scene_root(i);
Ref<Texture> icon;
- if (type != String()) {
- icon = get_class_icon(type, "Node");
+ if (type_node) {
+ icon = EditorNode::get_singleton()->get_object_icon(type_node, "Node");
}
int current = editor_data.get_edited_scene();
@@ -4232,7 +4232,13 @@ bool EditorNode::are_bottom_panels_hidden() const {
void EditorNode::hide_bottom_panel() {
- _bottom_panel_switch(false, 0);
+ for (int i = 0; i < bottom_panel_items.size(); i++) {
+
+ if (bottom_panel_items[i].control->is_visible()) {
+ _bottom_panel_switch(false, i);
+ break;
+ }
+ }
}
void EditorNode::make_bottom_panel_item_visible(Control *p_item) {
@@ -4269,7 +4275,7 @@ void EditorNode::remove_bottom_panel_item(Control *p_item) {
if (bottom_panel_items[i].control == p_item) {
if (p_item->is_visible_in_tree()) {
- _bottom_panel_switch(false, 0);
+ _bottom_panel_switch(false, i);
}
bottom_panel_vb->remove_child(bottom_panel_items[i].control);
bottom_panel_hb_editors->remove_child(bottom_panel_items[i].button);
@@ -4289,6 +4295,10 @@ void EditorNode::_bottom_panel_switch(bool p_enable, int p_idx) {
ERR_FAIL_INDEX(p_idx, bottom_panel_items.size());
+ if (bottom_panel_items[p_idx].control->is_visible() == p_enable) {
+ return;
+ }
+
if (p_enable) {
for (int i = 0; i < bottom_panel_items.size(); i++) {
@@ -4309,11 +4319,8 @@ void EditorNode::_bottom_panel_switch(bool p_enable, int p_idx) {
} else {
bottom_panel->add_style_override("panel", gui_base->get_stylebox("panel", "TabContainer"));
- for (int i = 0; i < bottom_panel_items.size(); i++) {
-
- bottom_panel_items[i].button->set_pressed(false);
- bottom_panel_items[i].control->set_visible(false);
- }
+ bottom_panel_items[p_idx].button->set_pressed(false);
+ bottom_panel_items[p_idx].control->set_visible(false);
center_split->set_dragger_visibility(SplitContainer::DRAGGER_HIDDEN);
center_split->set_collapsed(true);
bottom_panel_raise->hide();