diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2017-09-26 00:11:46 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-26 00:11:46 +0200 |
commit | f577efd47ed2f0aa801155756e4ba5d5ea2d5f2b (patch) | |
tree | 05544efa89a521e0061f9ca82b57ccc69e0f5371 /editor | |
parent | e9e1753c3cf96015893d4d138d6f085995f00035 (diff) | |
parent | 05bb8e0c106686f2ed5a9aad0f76ecc64fa5faa0 (diff) | |
download | redot-engine-f577efd47ed2f0aa801155756e4ba5d5ea2d5f2b.tar.gz |
Merge pull request #11424 from groud/control_node_presets
Implements set_margins_preset(...)
Diffstat (limited to 'editor')
24 files changed, 51 insertions, 51 deletions
diff --git a/editor/animation_editor.cpp b/editor/animation_editor.cpp index 2965003645..3b1a7b6665 100644 --- a/editor/animation_editor.cpp +++ b/editor/animation_editor.cpp @@ -3900,7 +3900,7 @@ AnimationKeyEditor::AnimationKeyEditor() { //menu->get_popup()->connect("id_pressed",this,"_menu_callback"); hb = memnew(HBoxContainer); - hb->set_area_as_parent_rect(); + hb->set_anchors_and_margins_preset(Control::PRESET_WIDE); ec->add_child(hb); hb->set_v_size_flags(SIZE_EXPAND_FILL); @@ -3912,14 +3912,14 @@ AnimationKeyEditor::AnimationKeyEditor() { track_editor->set_h_size_flags(SIZE_EXPAND_FILL); track_pos = memnew(Control); - track_pos->set_area_as_parent_rect(); + track_pos->set_anchors_and_margins_preset(Control::PRESET_WIDE); track_pos->set_mouse_filter(MOUSE_FILTER_IGNORE); track_editor->add_child(track_pos); track_pos->connect("draw", this, "_track_position_draw"); select_anim_warning = memnew(Label); track_editor->add_child(select_anim_warning); - select_anim_warning->set_area_as_parent_rect(); + select_anim_warning->set_anchors_and_margins_preset(Control::PRESET_WIDE); select_anim_warning->set_text(TTR("Select an AnimationPlayer from the Scene Tree to edit animations.")); select_anim_warning->set_autowrap(true); select_anim_warning->set_align(Label::ALIGN_CENTER); @@ -3936,7 +3936,7 @@ AnimationKeyEditor::AnimationKeyEditor() { key_editor_tab->set_custom_minimum_size(Size2(200, 0) * EDSCALE); key_editor = memnew(PropertyEditor); - key_editor->set_area_as_parent_rect(); + key_editor->set_anchors_and_margins_preset(Control::PRESET_WIDE); key_editor->hide_top_label(); key_editor->set_name(TTR("Key")); key_editor_tab->add_child(key_editor); diff --git a/editor/editor_help.cpp b/editor/editor_help.cpp index 6c8bd0f14b..80e6f9807e 100644 --- a/editor/editor_help.cpp +++ b/editor/editor_help.cpp @@ -1790,7 +1790,7 @@ EditorHelp::EditorHelp() { { class_desc = memnew(RichTextLabel); vbc->add_child(class_desc); - class_desc->set_area_as_parent_rect(); + class_desc->set_anchors_and_margins_preset(Control::PRESET_WIDE); class_desc->set_v_size_flags(SIZE_EXPAND_FILL); class_desc->add_color_override("selection_color", EDITOR_DEF("text_editor/highlighting/selection_color", Color(0.2, 0.2, 1))); class_desc->connect("meta_clicked", this, "_class_desc_select"); @@ -1900,7 +1900,7 @@ EditorHelpBit::EditorHelpBit() { rich_text = memnew(RichTextLabel); add_child(rich_text); - rich_text->set_area_as_parent_rect(); + rich_text->set_anchors_and_margins_preset(Control::PRESET_WIDE); rich_text->connect("meta_clicked", this, "_meta_clicked"); rich_text->add_color_override("selection_color", EDITOR_DEF("text_editor/highlighting/selection_color", Color(0.2, 0.2, 1))); set_custom_minimum_size(Size2(0, 70 * EDSCALE)); diff --git a/editor/editor_log.cpp b/editor/editor_log.cpp index 3b20660013..46f8baa4c5 100644 --- a/editor/editor_log.cpp +++ b/editor/editor_log.cpp @@ -161,7 +161,7 @@ EditorLog::EditorLog() { log->set_selection_enabled(true); log->set_focus_mode(FOCUS_CLICK); log->set_custom_minimum_size(Size2(0, 180) * EDSCALE); - log->set_area_as_parent_rect(); + log->set_anchors_and_margins_preset(Control::PRESET_WIDE); log->set_v_size_flags(SIZE_EXPAND_FILL); log->set_h_size_flags(SIZE_EXPAND_FILL); vb->add_child(log); diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 5a38ec939f..dbee190d7e 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -4671,11 +4671,11 @@ EditorNode::EditorNode() { theme_base = memnew(Control); add_child(theme_base); - theme_base->set_area_as_parent_rect(); + theme_base->set_anchors_and_margins_preset(Control::PRESET_WIDE); gui_base = memnew(Panel); theme_base->add_child(gui_base); - gui_base->set_area_as_parent_rect(); + gui_base->set_anchors_and_margins_preset(Control::PRESET_WIDE); Ref<Theme> theme = create_editor_theme(); theme_base->set_theme(theme); @@ -4694,7 +4694,7 @@ EditorNode::EditorNode() { main_vbox = memnew(VBoxContainer); gui_base->add_child(main_vbox); - main_vbox->set_area_as_parent_rect(8); + main_vbox->set_anchors_and_margins_preset(Control::PRESET_WIDE, Control::PRESET_MODE_MINSIZE, 8); main_vbox->set_margin(MARGIN_TOP, 5 * EDSCALE); menu_hb = memnew(HBoxContainer); @@ -5083,7 +5083,7 @@ EditorNode::EditorNode() { play_cc = memnew(CenterContainer); play_cc->set_mouse_filter(Control::MOUSE_FILTER_IGNORE); menu_hb->add_child(play_cc); - play_cc->set_area_as_parent_rect(); + play_cc->set_anchors_and_margins_preset(Control::PRESET_WIDE); play_cc->set_anchor_and_margin(MARGIN_BOTTOM, Control::ANCHOR_BEGIN, 10); play_cc->set_margin(MARGIN_TOP, 5); diff --git a/editor/plugins/animation_player_editor_plugin.cpp b/editor/plugins/animation_player_editor_plugin.cpp index de905d80ef..bdfe380211 100644 --- a/editor/plugins/animation_player_editor_plugin.cpp +++ b/editor/plugins/animation_player_editor_plugin.cpp @@ -1426,7 +1426,7 @@ AnimationPlayerEditorPlugin::AnimationPlayerEditorPlugin(EditorNode *p_node) { editor->add_bottom_panel_item(TTR("Animation"), anim_editor); /* editor->get_viewport()->add_child(anim_editor); - anim_editor->set_area_as_parent_rect(); + anim_editor->set_anchors_and_margins_preset(Control::PRESET_WIDE); anim_editor->set_anchor( MARGIN_TOP, Control::ANCHOR_END); anim_editor->set_margin( MARGIN_TOP, 75 ); anim_editor->set_anchor( MARGIN_RIGHT, Control::ANCHOR_END); diff --git a/editor/plugins/asset_library_editor_plugin.cpp b/editor/plugins/asset_library_editor_plugin.cpp index 626b4f5a7f..db3a303a9b 100644 --- a/editor/plugins/asset_library_editor_plugin.cpp +++ b/editor/plugins/asset_library_editor_plugin.cpp @@ -1478,7 +1478,7 @@ AssetLibraryEditorPlugin::AssetLibraryEditorPlugin(EditorNode *p_node) { addon_library = memnew(EditorAssetLibrary); addon_library->set_v_size_flags(Control::SIZE_EXPAND_FILL); editor->get_viewport()->add_child(addon_library); - addon_library->set_area_as_parent_rect(); + addon_library->set_anchors_and_margins_preset(Control::PRESET_WIDE); addon_library->hide(); } diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index d3a0685777..b6b112b905 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -3050,7 +3050,7 @@ void CanvasItemEditor::_set_full_rect() { Control *c = Object::cast_to<Control>(E->get()); - undo_redo->add_do_method(c, "set_anchors_preset", PRESET_WIDE); + undo_redo->add_do_method(c, "set_anchors_preset", Control::PRESET_WIDE); undo_redo->add_do_method(c, "set_margin", MARGIN_LEFT, 0); undo_redo->add_do_method(c, "set_margin", MARGIN_TOP, 0); undo_redo->add_do_method(c, "set_margin", MARGIN_RIGHT, 0); @@ -3301,7 +3301,7 @@ void CanvasItemEditor::_popup_callback(int p_op) { _set_anchors_preset(PRESET_HCENTER_WIDE); } break; case ANCHOR_ALIGN_WIDE: { - _set_anchors_preset(PRESET_WIDE); + _set_anchors_preset(Control::PRESET_WIDE); } break; case ANCHOR_ALIGN_WIDE_FIT: { _set_full_rect(); @@ -3698,7 +3698,7 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { hb = memnew(HBoxContainer); add_child(hb); - hb->set_area_as_parent_rect(); + hb->set_anchors_and_margins_preset(Control::PRESET_WIDE); bottom_split = memnew(VSplitContainer); add_child(bottom_split); @@ -3721,19 +3721,19 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { viewport_base->add_child(viewport_scrollable); viewport_scrollable->set_mouse_filter(MOUSE_FILTER_PASS); viewport_scrollable->set_draw_behind_parent(true); - viewport_scrollable->set_area_as_parent_rect(); + viewport_scrollable->set_anchors_and_margins_preset(Control::PRESET_WIDE); viewport_scrollable->set_begin(Point2(RULER_WIDTH, RULER_WIDTH)); ViewportContainer *scene_tree = memnew(ViewportContainer); viewport_scrollable->add_child(scene_tree); scene_tree->set_stretch(true); - scene_tree->set_area_as_parent_rect(); + scene_tree->set_anchors_and_margins_preset(Control::PRESET_WIDE); scene_tree->add_child(p_editor->get_scene_root()); viewport = memnew(CanvasItemEditorViewport(p_editor, this)); viewport_scrollable->add_child(viewport); viewport->set_mouse_filter(MOUSE_FILTER_PASS); - viewport->set_area_as_parent_rect(); + viewport->set_anchors_and_margins_preset(Control::PRESET_WIDE); viewport->set_clip_contents(true); viewport->connect("draw", this, "_draw_viewport"); @@ -4059,7 +4059,7 @@ CanvasItemEditorPlugin::CanvasItemEditorPlugin(EditorNode *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->set_anchors_and_margins_preset(Control::PRESET_WIDE); canvas_item_editor->hide(); } diff --git a/editor/plugins/cube_grid_theme_editor_plugin.cpp b/editor/plugins/cube_grid_theme_editor_plugin.cpp index 1c17daf425..2b31f192b3 100644 --- a/editor/plugins/cube_grid_theme_editor_plugin.cpp +++ b/editor/plugins/cube_grid_theme_editor_plugin.cpp @@ -241,7 +241,7 @@ MeshLibraryEditor::MeshLibraryEditor(EditorNode *p_editor) { file->connect("file_selected", this, "_import_scene_cbk"); Panel *panel = memnew(Panel); - panel->set_area_as_parent_rect(); + panel->set_anchors_and_margins_preset(Control::PRESET_WIDE); add_child(panel); MenuButton *options = memnew(MenuButton); panel->add_child(options); @@ -289,7 +289,7 @@ MeshLibraryEditorPlugin::MeshLibraryEditorPlugin(EditorNode *p_node) { theme_editor = memnew(MeshLibraryEditor(p_node)); p_node->get_viewport()->add_child(theme_editor); - theme_editor->set_area_as_parent_rect(); + theme_editor->set_anchors_and_margins_preset(Control::PRESET_WIDE); theme_editor->set_anchor(MARGIN_BOTTOM, Control::ANCHOR_BEGIN); theme_editor->set_end(Point2(0, 22)); theme_editor->hide(); diff --git a/editor/plugins/material_editor_plugin.cpp b/editor/plugins/material_editor_plugin.cpp index 5ea6b4b6b2..b96e10e81a 100644 --- a/editor/plugins/material_editor_plugin.cpp +++ b/editor/plugins/material_editor_plugin.cpp @@ -337,7 +337,7 @@ MaterialEditor::MaterialEditor() { HBoxContainer *hb = memnew( HBoxContainer ); add_child(hb); - hb->set_area_as_parent_rect(2); + hb->set_anchors_and_margins_preset(Control::PRESET_WIDE, Control::PRESET_MODE_MINSIZE, 2); VBoxContainer *vb_shape = memnew( VBoxContainer ); hb->add_child(vb_shape); diff --git a/editor/plugins/mesh_editor_plugin.cpp b/editor/plugins/mesh_editor_plugin.cpp index a77f022347..b775636764 100644 --- a/editor/plugins/mesh_editor_plugin.cpp +++ b/editor/plugins/mesh_editor_plugin.cpp @@ -162,7 +162,7 @@ MeshEditor::MeshEditor() { HBoxContainer *hb = memnew(HBoxContainer); add_child(hb); - hb->set_area_as_parent_rect(2); + hb->set_anchors_and_margins_preset(Control::PRESET_WIDE, Control::PRESET_MODE_MINSIZE, 2); hb->add_spacer(); diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp index d3c75d1c42..47443b81ce 100644 --- a/editor/plugins/script_text_editor.cpp +++ b/editor/plugins/script_text_editor.cpp @@ -1455,7 +1455,7 @@ ScriptTextEditor::ScriptTextEditor() { code_editor = memnew(CodeTextEditor); add_child(code_editor); code_editor->add_constant_override("separation", 0); - code_editor->set_area_as_parent_rect(); + code_editor->set_anchors_and_margins_preset(Control::PRESET_WIDE); code_editor->connect("validate_script", this, "_validate_script"); code_editor->connect("load_theme_settings", this, "_load_theme_settings"); code_editor->set_code_complete_func(_code_complete_scripts, this); diff --git a/editor/plugins/shader_graph_editor_plugin.cpp b/editor/plugins/shader_graph_editor_plugin.cpp index f1863c3ca4..cd90d47896 100644 --- a/editor/plugins/shader_graph_editor_plugin.cpp +++ b/editor/plugins/shader_graph_editor_plugin.cpp @@ -2921,7 +2921,7 @@ ShaderGraphEditorPlugin::ShaderGraphEditorPlugin(EditorNode *p_node, bool p_2d) //editor->get_viewport()->add_child(shader_editor); - //shader_editor->set_area_as_parent_rect(); + //shader_editor->set_anchors_and_margins_preset(Control::PRESET_WIDE); //shader_editor->hide(); } diff --git a/editor/plugins/spatial_editor_plugin.cpp b/editor/plugins/spatial_editor_plugin.cpp index bfdbdda8fe..2a6e3b4f0a 100644 --- a/editor/plugins/spatial_editor_plugin.cpp +++ b/editor/plugins/spatial_editor_plugin.cpp @@ -2842,7 +2842,7 @@ SpatialEditorViewport::SpatialEditorViewport(SpatialEditor *p_spatial_editor, Ed ViewportContainer *c = memnew(ViewportContainer); c->set_stretch(true); add_child(c); - c->set_area_as_parent_rect(); + c->set_anchors_and_margins_preset(Control::PRESET_WIDE); viewport = memnew(Viewport); viewport->set_disable_input(true); @@ -2850,7 +2850,7 @@ SpatialEditorViewport::SpatialEditorViewport(SpatialEditor *p_spatial_editor, Ed surface = memnew(Control); surface->set_drag_forwarding(this); add_child(surface); - surface->set_area_as_parent_rect(); + surface->set_anchors_and_margins_preset(Control::PRESET_WIDE); surface->set_clip_contents(true); camera = memnew(Camera); camera->set_disable_gizmo(true); @@ -4222,7 +4222,7 @@ void SpatialEditor::_toggle_maximize_view(Object *p_viewport) { for (uint32_t i = 0; i < VIEWPORTS_COUNT; i++) { if (i == (uint32_t)index) - viewports[i]->set_area_as_parent_rect(); + viewports[i]->set_anchors_and_margins_preset(Control::PRESET_WIDE); else viewports[i]->hide(); } @@ -4648,7 +4648,7 @@ SpatialEditorPlugin::SpatialEditorPlugin(EditorNode *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_anchors_and_margins_preset(Control::PRESET_WIDE); spatial_editor->hide(); spatial_editor->connect("transform_key_request", editor, "_transform_keyed"); diff --git a/editor/plugins/style_box_editor_plugin.cpp b/editor/plugins/style_box_editor_plugin.cpp index 478ca2e972..5c965e4a05 100644 --- a/editor/plugins/style_box_editor_plugin.cpp +++ b/editor/plugins/style_box_editor_plugin.cpp @@ -57,7 +57,7 @@ StyleBoxEditor::StyleBoxEditor() { panel = memnew(Panel); add_child(panel); - panel->set_area_as_parent_rect(); + panel->set_anchors_and_margins_preset(Control::PRESET_WIDE); Label *l = memnew(Label); l->set_text(TTR("StyleBox Preview:")); diff --git a/editor/plugins/texture_region_editor_plugin.cpp b/editor/plugins/texture_region_editor_plugin.cpp index 38d1350b07..41c2c61d82 100644 --- a/editor/plugins/texture_region_editor_plugin.cpp +++ b/editor/plugins/texture_region_editor_plugin.cpp @@ -773,7 +773,7 @@ TextureRegionEditor::TextureRegionEditor(EditorNode *p_editor) { VBoxContainer *main_vb = memnew(VBoxContainer); add_child(main_vb); - main_vb->set_area_as_parent_rect(0); + main_vb->set_anchors_and_margins_preset(Control::PRESET_WIDE); HBoxContainer *hb_tools = memnew(HBoxContainer); main_vb->add_child(hb_tools); diff --git a/editor/plugins/theme_editor_plugin.cpp b/editor/plugins/theme_editor_plugin.cpp index 86ef1a489f..e500dec0ef 100644 --- a/editor/plugins/theme_editor_plugin.cpp +++ b/editor/plugins/theme_editor_plugin.cpp @@ -607,7 +607,7 @@ ThemeEditor::ThemeEditor() { scroll = memnew(ScrollContainer); add_child(scroll); - scroll->set_area_as_parent_rect(3); + scroll->set_anchors_and_margins_preset(Control::PRESET_WIDE, Control::PRESET_MODE_MINSIZE, 3); scroll->set_margin(MARGIN_TOP, 30 * EDSCALE); //scroll->set_enable_h_scroll(true); scroll->set_enable_v_scroll(true); @@ -621,7 +621,7 @@ ThemeEditor::ThemeEditor() { main_vb = memnew(VBoxContainer); panel->add_child(main_vb); - main_vb->set_area_as_parent_rect(4 * EDSCALE); + main_vb->set_anchors_and_margins_preset(Control::PRESET_WIDE, Control::PRESET_MODE_MINSIZE, 4 * EDSCALE); HBoxContainer *hb_menu = memnew(HBoxContainer); main_vb->add_child(hb_menu); @@ -648,7 +648,7 @@ ThemeEditor::ThemeEditor() { main_hb->add_child(first_vb); //main_panel->add_child(panel); - //panel->set_area_as_parent_rect(); + //panel->set_anchors_and_margins_preset(Control::PRESET_WIDE); //panel->set_margin( MARGIN_TOP,20 ); first_vb->add_child(memnew(Label("Label"))); diff --git a/editor/plugins/tile_set_editor_plugin.cpp b/editor/plugins/tile_set_editor_plugin.cpp index 443c280428..f2f71ba6b1 100644 --- a/editor/plugins/tile_set_editor_plugin.cpp +++ b/editor/plugins/tile_set_editor_plugin.cpp @@ -238,7 +238,7 @@ void TileSetEditor::_bind_methods() { TileSetEditor::TileSetEditor(EditorNode *p_editor) { Panel *panel = memnew(Panel); - panel->set_area_as_parent_rect(); + panel->set_anchors_and_margins_preset(Control::PRESET_WIDE); add_child(panel); MenuButton *options = memnew(MenuButton); panel->add_child(options); @@ -293,7 +293,7 @@ TileSetEditorPlugin::TileSetEditorPlugin(EditorNode *p_node) { tileset_editor = memnew(TileSetEditor(p_node)); p_node->get_viewport()->add_child(tileset_editor); - tileset_editor->set_area_as_parent_rect(); + tileset_editor->set_anchors_and_margins_preset(Control::PRESET_WIDE); tileset_editor->set_anchor(MARGIN_BOTTOM, Control::ANCHOR_BEGIN); tileset_editor->set_end(Point2(0, 22)); tileset_editor->hide(); diff --git a/editor/progress_dialog.cpp b/editor/progress_dialog.cpp index 376d9d3158..09f5375bb4 100644 --- a/editor/progress_dialog.cpp +++ b/editor/progress_dialog.cpp @@ -49,7 +49,7 @@ void BackgroundProgress::_add_task(const String &p_task, const String &p_label, Control *ec = memnew(Control); ec->set_h_size_flags(SIZE_EXPAND_FILL); ec->set_v_size_flags(SIZE_EXPAND_FILL); - t.progress->set_area_as_parent_rect(); + t.progress->set_anchors_and_margins_preset(Control::PRESET_WIDE); ec->add_child(t.progress); ec->set_custom_minimum_size(Size2(80, 5) * EDSCALE); t.hb->add_child(ec); @@ -222,7 +222,7 @@ ProgressDialog::ProgressDialog() { main = memnew(VBoxContainer); add_child(main); - main->set_area_as_parent_rect(); + main->set_anchors_and_margins_preset(Control::PRESET_WIDE); set_exclusive(true); last_progress_tick = 0; singleton = this; diff --git a/editor/project_export.cpp b/editor/project_export.cpp index c3b50657f9..506619a2a7 100644 --- a/editor/project_export.cpp +++ b/editor/project_export.cpp @@ -894,7 +894,7 @@ ProjectExportDialog::ProjectExportDialog() { Panel *features_panel = memnew(Panel); custom_feature_display = memnew(RichTextLabel); features_panel->add_child(custom_feature_display); - custom_feature_display->set_area_as_parent_rect(10 * EDSCALE); + custom_feature_display->set_anchors_and_margins_preset(Control::PRESET_WIDE, Control::PRESET_MODE_MINSIZE, 10 * EDSCALE); custom_feature_display->set_v_size_flags(SIZE_EXPAND_FILL); feature_vb->add_margin_child(TTR("Feature List:"), features_panel, true); sections->add_child(feature_vb); diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp index 5ab0253d6d..c679b44342 100644 --- a/editor/project_manager.cpp +++ b/editor/project_manager.cpp @@ -1434,21 +1434,21 @@ ProjectManager::ProjectManager() { FileDialog::set_default_show_hidden_files(EditorSettings::get_singleton()->get("filesystem/file_dialog/show_hidden_files")); - set_area_as_parent_rect(); + set_anchors_and_margins_preset(Control::PRESET_WIDE); set_theme(create_editor_theme()); gui_base = memnew(Control); add_child(gui_base); - gui_base->set_area_as_parent_rect(); + gui_base->set_anchors_and_margins_preset(Control::PRESET_WIDE); gui_base->set_theme(create_custom_theme()); Panel *panel = memnew(Panel); gui_base->add_child(panel); - panel->set_area_as_parent_rect(); + panel->set_anchors_and_margins_preset(Control::PRESET_WIDE); VBoxContainer *vb = memnew(VBoxContainer); panel->add_child(vb); - vb->set_area_as_parent_rect(20 * EDSCALE); + vb->set_anchors_and_margins_preset(Control::PRESET_WIDE, Control::PRESET_MODE_MINSIZE, 20 * EDSCALE); vb->set_margin(MARGIN_TOP, 4 * EDSCALE); vb->set_margin(MARGIN_BOTTOM, -4 * EDSCALE); vb->add_constant_override("separation", 15 * EDSCALE); diff --git a/editor/project_settings_editor.cpp b/editor/project_settings_editor.cpp index 1f65589643..34c0d7e578 100644 --- a/editor/project_settings_editor.cpp +++ b/editor/project_settings_editor.cpp @@ -1504,7 +1504,7 @@ ProjectSettingsEditor::ProjectSettingsEditor(EditorData *p_data) { Control *input_base = memnew(Control); input_base->set_name(TTR("Input Map")); - input_base->set_area_as_parent_rect(); + input_base->set_anchors_and_margins_preset(Control::PRESET_WIDE); tab_container->add_child(input_base); VBoxContainer *vbc = memnew(VBoxContainer); @@ -1552,7 +1552,7 @@ ProjectSettingsEditor::ProjectSettingsEditor(EditorData *p_data) { l = memnew(Label); l->set_text(TTR("Press a Key..")); - l->set_area_as_parent_rect(); + l->set_anchors_and_margins_preset(Control::PRESET_WIDE); l->set_align(Label::ALIGN_CENTER); l->set_margin(MARGIN_TOP, 20); l->set_anchor_and_margin(MARGIN_BOTTOM, ANCHOR_BEGIN, 30); diff --git a/editor/property_editor.cpp b/editor/property_editor.cpp index 81bd450484..ed90c8c4b2 100644 --- a/editor/property_editor.cpp +++ b/editor/property_editor.cpp @@ -1889,7 +1889,7 @@ CustomPropertyEditor::CustomPropertyEditor() { text_edit = memnew(TextEdit); add_child(text_edit); - text_edit->set_area_as_parent_rect(5); + text_edit->set_anchors_and_margins_preset(Control::PRESET_WIDE, Control::PRESET_MODE_MINSIZE, 5); text_edit->set_margin(MARGIN_BOTTOM, -30); text_edit->hide(); @@ -1948,12 +1948,12 @@ CustomPropertyEditor::CustomPropertyEditor() { spinbox = memnew(SpinBox); add_child(spinbox); - spinbox->set_area_as_parent_rect(5); + spinbox->set_anchors_and_margins_preset(Control::PRESET_WIDE, Control::PRESET_MODE_MINSIZE, 5); spinbox->connect("value_changed", this, "_range_modified"); slider = memnew(HSlider); add_child(slider); - slider->set_area_as_parent_rect(5); + slider->set_anchors_and_margins_preset(Control::PRESET_WIDE, Control::PRESET_MODE_MINSIZE, 5); slider->connect("value_changed", this, "_range_modified"); create_dialog = NULL; diff --git a/editor/script_editor_debugger.cpp b/editor/script_editor_debugger.cpp index d71bc1838b..8d3eb5974e 100644 --- a/editor/script_editor_debugger.cpp +++ b/editor/script_editor_debugger.cpp @@ -1622,7 +1622,7 @@ ScriptEditorDebugger::ScriptEditorDebugger(EditorNode *p_editor) { tabs->add_style_override("panel", editor->get_gui_base()->get_stylebox("DebuggerPanel", "EditorStyles")); tabs->add_style_override("tab_fg", editor->get_gui_base()->get_stylebox("DebuggerTabFG", "EditorStyles")); tabs->add_style_override("tab_bg", editor->get_gui_base()->get_stylebox("DebuggerTabBG", "EditorStyles")); - tabs->set_area_as_parent_rect(); + tabs->set_anchors_and_margins_preset(Control::PRESET_WIDE); add_child(tabs); { //debugger diff --git a/editor/settings_config_dialog.cpp b/editor/settings_config_dialog.cpp index 7d7fb9fc21..c90626976d 100644 --- a/editor/settings_config_dialog.cpp +++ b/editor/settings_config_dialog.cpp @@ -375,7 +375,7 @@ EditorSettingsDialog::EditorSettingsDialog() { l = memnew(Label); l->set_text(TTR("Press a Key..")); - l->set_area_as_parent_rect(); + l->set_anchors_and_margins_preset(Control::PRESET_WIDE); l->set_align(Label::ALIGN_CENTER); l->set_margin(MARGIN_TOP, 20); l->set_anchor_and_margin(MARGIN_BOTTOM, ANCHOR_BEGIN, 30); |