From 37eaa9d7923e69d7aa31926b868a31b3b6157e46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Sun, 2 Jul 2017 13:16:39 +0200 Subject: [PATCH] EditorNameDialog: Fix margins Somehow the previous code is what works in *master*, though it looks buggy. For 2.1, the margins should be set on the container itself. --- editor/editor_name_dialog.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/editor/editor_name_dialog.cpp b/editor/editor_name_dialog.cpp index e4ee6b171c6..2e24af10294 100644 --- a/editor/editor_name_dialog.cpp +++ b/editor/editor_name_dialog.cpp @@ -80,11 +80,12 @@ void EditorNameDialog::_bind_methods() { EditorNameDialog::EditorNameDialog() { makevb = memnew(VBoxContainer); + makevb->set_margin(MARGIN_TOP, 5); + makevb->set_anchor_and_margin(MARGIN_LEFT, ANCHOR_BEGIN, 5); + makevb->set_anchor_and_margin(MARGIN_RIGHT, ANCHOR_END, 5); add_child(makevb); + name = memnew(LineEdit); makevb->add_child(name); - name->set_margin(MARGIN_TOP, 5); - name->set_anchor_and_margin(MARGIN_LEFT, ANCHOR_BEGIN, 5); - name->set_anchor_and_margin(MARGIN_RIGHT, ANCHOR_END, 5); name->connect("input_event", this, "_line_input_event"); }