diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp index 1abcb8f6042..b270d8b8cc2 100644 --- a/tools/editor/editor_node.cpp +++ b/tools/editor/editor_node.cpp @@ -5041,10 +5041,14 @@ EditorNode::EditorNode() { srt->add_child(scene_tabs); - scene_root_parent = memnew( Panel ); + scene_root_parent = memnew( PanelContainer ); + scene_root_parent->set_custom_minimum_size(Size2(0,80)); + + + //Ref sp = scene_root_parent->get_stylebox("panel","TabContainer"); + //scene_root_parent->add_style_override("panel",sp); + - Ref sp = scene_root_parent->get_stylebox("panel","TabContainer"); - scene_root_parent->add_style_override("panel",sp); /*scene_root_parent->set_anchor( MARGIN_RIGHT, Control::ANCHOR_END ); scene_root_parent->set_anchor( MARGIN_BOTTOM, Control::ANCHOR_END ); scene_root_parent->set_begin( Point2( 0, 0) ); @@ -5052,13 +5056,6 @@ EditorNode::EditorNode() { srt->add_child(scene_root_parent); scene_root_parent->set_v_size_flags(Control::SIZE_EXPAND_FILL); - scene_root_base = memnew( Control ); - scene_root_base->set_area_as_parent_rect(); - for(int i=0;i<4;i++) { - scene_root_base->set_margin(Margin(i),sp->get_margin(Margin(i))); - } - scene_root_parent->add_child(scene_root_base); - scene_root = memnew( Viewport ); @@ -5073,11 +5070,11 @@ EditorNode::EditorNode() { // scene_root->set_world_2d( Ref( memnew( World2D )) ); - viewport = memnew( Control ); - viewport->set_area_as_parent_rect(4); - for(int i=0;i<4;i++) { + viewport = memnew( VBoxContainer ); + viewport->set_v_size_flags(Control::SIZE_EXPAND_FILL); + /*for(int i=0;i<4;i++) { viewport->set_margin(Margin(i),sp->get_margin(Margin(i))); - } + }*/ scene_root_parent->add_child(viewport); diff --git a/tools/editor/editor_node.h b/tools/editor/editor_node.h index c687643d305..a8aa6ac1f4c 100644 --- a/tools/editor/editor_node.h +++ b/tools/editor/editor_node.h @@ -258,7 +258,7 @@ class EditorNode : public Node { TextEdit *load_errors; AcceptDialog *load_error_dialog; - Control *scene_root_base; + //Control *scene_root_base; Ref theme; PopupMenu *recent_scenes; diff --git a/tools/editor/plugins/canvas_item_editor_plugin.cpp b/tools/editor/plugins/canvas_item_editor_plugin.cpp index 0afea269577..ef2df539e88 100644 --- a/tools/editor/plugins/canvas_item_editor_plugin.cpp +++ b/tools/editor/plugins/canvas_item_editor_plugin.cpp @@ -3528,6 +3528,7 @@ CanvasItemEditorPlugin::CanvasItemEditorPlugin(EditorNode *p_node) { editor=p_node; canvas_item_editor = memnew( CanvasItemEditor(editor) ); + canvas_item_editor->set_v_size_flags(Control::SIZE_EXPAND_FILL); editor->get_viewport()->add_child(canvas_item_editor); canvas_item_editor->set_area_as_parent_rect(); canvas_item_editor->hide(); diff --git a/tools/editor/plugins/script_editor_plugin.cpp b/tools/editor/plugins/script_editor_plugin.cpp index 5b1dd37a619..bef74ebcfef 100644 --- a/tools/editor/plugins/script_editor_plugin.cpp +++ b/tools/editor/plugins/script_editor_plugin.cpp @@ -2677,7 +2677,7 @@ ScriptEditorPlugin::ScriptEditorPlugin(EditorNode *p_node) { editor=p_node; script_editor = memnew( ScriptEditor(p_node) ); editor->get_viewport()->add_child(script_editor); - script_editor->set_area_as_parent_rect(); + script_editor->set_v_size_flags(Control::SIZE_EXPAND_FILL); script_editor->hide(); diff --git a/tools/editor/plugins/spatial_editor_plugin.cpp b/tools/editor/plugins/spatial_editor_plugin.cpp index 236d69dfb3c..cf92473919f 100644 --- a/tools/editor/plugins/spatial_editor_plugin.cpp +++ b/tools/editor/plugins/spatial_editor_plugin.cpp @@ -4217,8 +4217,10 @@ SpatialEditorPlugin::SpatialEditorPlugin(EditorNode *p_node) { editor=p_node; spatial_editor = memnew( SpatialEditor(p_node) ); + spatial_editor->set_v_size_flags(Control::SIZE_EXPAND_FILL); editor->get_viewport()->add_child(spatial_editor); - spatial_editor->set_area_as_parent_rect(); + + //spatial_editor->set_area_as_parent_rect(); spatial_editor->hide(); spatial_editor->connect("transform_key_request",editor,"_transform_keyed");