summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2017-08-20 15:24:00 +0200
committerGitHub <noreply@github.com>2017-08-20 15:24:00 +0200
commit5627047c32bf20d7fc83998c6ab9899744160175 (patch)
tree6a01b2b424e3631856d5b737c71f733ad02ab7cc
parent7e5890d23d882547ae465fb7756b74be5bc1f62b (diff)
parent06256cd7782de2d91cd9ed3bcb9a05e293397303 (diff)
Merge pull request #10455 from groud/control_margin_fixes
Some control fixes and removed other useless lines
-rw-r--r--editor/plugins/cube_grid_theme_editor_plugin.cpp1
-rw-r--r--editor/plugins/sample_editor_plugin.cpp4
-rw-r--r--editor/plugins/tile_set_editor_plugin.cpp1
-rw-r--r--editor/project_manager.cpp3
-rw-r--r--editor/property_editor.cpp6
-rw-r--r--modules/gridmap/grid_map_editor_plugin.cpp2
-rw-r--r--modules/visual_script/visual_script_editor.cpp1
-rw-r--r--scene/gui/popup.cpp7
8 files changed, 10 insertions, 15 deletions
diff --git a/editor/plugins/cube_grid_theme_editor_plugin.cpp b/editor/plugins/cube_grid_theme_editor_plugin.cpp
index b26b2aec4f..1fcd514b31 100644
--- a/editor/plugins/cube_grid_theme_editor_plugin.cpp
+++ b/editor/plugins/cube_grid_theme_editor_plugin.cpp
@@ -368,7 +368,6 @@ MeshLibraryEditorPlugin::MeshLibraryEditorPlugin(EditorNode *p_node) {
p_node->get_viewport()->add_child(theme_editor);
theme_editor->set_area_as_parent_rect();
- theme_editor->set_anchor(MARGIN_RIGHT, Control::ANCHOR_END);
theme_editor->set_anchor(MARGIN_BOTTOM, Control::ANCHOR_BEGIN);
theme_editor->set_end(Point2(0, 22));
theme_editor->hide();
diff --git a/editor/plugins/sample_editor_plugin.cpp b/editor/plugins/sample_editor_plugin.cpp
index 1d6417e2d5..2dd6de1683 100644
--- a/editor/plugins/sample_editor_plugin.cpp
+++ b/editor/plugins/sample_editor_plugin.cpp
@@ -374,8 +374,8 @@ SampleEditor::SampleEditor() {
sample_texframe->add_child(info_label);
info_label->set_area_as_parent_rect();
info_label->set_anchor_and_margin(MARGIN_TOP,ANCHOR_END,-15);
- info_label->set_margin(MARGIN_BOTTOM,4);
- info_label->set_margin(MARGIN_RIGHT,4);
+ info_label->set_margin(MARGIN_BOTTOM,-4);
+ info_label->set_margin(MARGIN_RIGHT,-4);
info_label->set_align(Label::ALIGN_RIGHT);
diff --git a/editor/plugins/tile_set_editor_plugin.cpp b/editor/plugins/tile_set_editor_plugin.cpp
index bed4727bb9..8396b4d412 100644
--- a/editor/plugins/tile_set_editor_plugin.cpp
+++ b/editor/plugins/tile_set_editor_plugin.cpp
@@ -294,7 +294,6 @@ TileSetEditorPlugin::TileSetEditorPlugin(EditorNode *p_node) {
p_node->get_viewport()->add_child(tileset_editor);
tileset_editor->set_area_as_parent_rect();
- tileset_editor->set_anchor(MARGIN_RIGHT, Control::ANCHOR_END);
tileset_editor->set_anchor(MARGIN_BOTTOM, Control::ANCHOR_BEGIN);
tileset_editor->set_end(Point2(0, 22));
tileset_editor->hide();
diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp
index dc0c888eea..1ea8440508 100644
--- a/editor/project_manager.cpp
+++ b/editor/project_manager.cpp
@@ -969,7 +969,6 @@ void ProjectManager::_run_project_confirm() {
return;
}
-
const String &selected = E->key();
String path = EditorSettings::get_singleton()->get("projects/" + selected);
@@ -1220,7 +1219,7 @@ ProjectManager::ProjectManager() {
panel->add_child(vb);
vb->set_area_as_parent_rect(20 * EDSCALE);
vb->set_margin(MARGIN_TOP, 4 * EDSCALE);
- vb->set_margin(MARGIN_BOTTOM, 4 * EDSCALE);
+ vb->set_margin(MARGIN_BOTTOM, -4 * EDSCALE);
vb->add_constant_override("separation", 15 * EDSCALE);
String cp;
diff --git a/editor/property_editor.cpp b/editor/property_editor.cpp
index 0ec83d8a36..1bd748a083 100644
--- a/editor/property_editor.cpp
+++ b/editor/property_editor.cpp
@@ -1939,10 +1939,8 @@ CustomPropertyEditor::CustomPropertyEditor() {
text_edit = memnew(TextEdit);
add_child(text_edit);
- text_edit->set_area_as_parent_rect();
- for (int i = 0; i < 4; i++)
- text_edit->set_margin((Margin)i, 5);
- text_edit->set_margin(MARGIN_BOTTOM, 30);
+ text_edit->set_area_as_parent_rect(5);
+ text_edit->set_margin(MARGIN_BOTTOM, -30);
text_edit->hide();
text_edit->connect("text_changed", this, "_text_edit_changed");
diff --git a/modules/gridmap/grid_map_editor_plugin.cpp b/modules/gridmap/grid_map_editor_plugin.cpp
index 38f58799df..7bb80c2510 100644
--- a/modules/gridmap/grid_map_editor_plugin.cpp
+++ b/modules/gridmap/grid_map_editor_plugin.cpp
@@ -1203,7 +1203,7 @@ GridMapEditor::GridMapEditor(EditorNode *p_editor) {
edit_mode = memnew(OptionButton);
edit_mode->set_area_as_parent_rect();
edit_mode->set_anchor_and_margin(MARGIN_BOTTOM, ANCHOR_BEGIN, 24);
- edit_mode->set_anchor_and_margin(MARGIN_RIGHT, ANCHOR_END, -14);
+ edit_mode->set_margin(MARGIN_RIGHT, -14);
edit_mode->add_item("Tiles");
edit_mode->add_item("Areas");
hb->add_child(edit_mode);
diff --git a/modules/visual_script/visual_script_editor.cpp b/modules/visual_script/visual_script_editor.cpp
index 9a1033e954..b9e7a6ffc4 100644
--- a/modules/visual_script/visual_script_editor.cpp
+++ b/modules/visual_script/visual_script_editor.cpp
@@ -3279,7 +3279,6 @@ VisualScriptEditor::VisualScriptEditor() {
select_func_text->set_valign(Label::VALIGN_CENTER);
select_func_text->set_h_size_flags(SIZE_EXPAND_FILL);
add_child(select_func_text);
- graph->set_area_as_parent_rect();
hint_text = memnew(Label);
hint_text->set_anchor_and_margin(MARGIN_TOP, ANCHOR_END, -100);
diff --git a/scene/gui/popup.cpp b/scene/gui/popup.cpp
index f2ba6bfbc4..b21139f969 100644
--- a/scene/gui/popup.cpp
+++ b/scene/gui/popup.cpp
@@ -276,9 +276,10 @@ void PopupPanel::set_child_rect(Control *p_child) {
Ref<StyleBox> p = get_stylebox("panel");
p_child->set_area_as_parent_rect();
- for (int i = 0; i < 4; i++) {
- p_child->set_margin(Margin(i), p->get_margin(Margin(i)));
- }
+ p_child->set_margin(MARGIN_LEFT, p->get_margin(MARGIN_LEFT));
+ p_child->set_margin(MARGIN_RIGHT, -p->get_margin(MARGIN_RIGHT));
+ p_child->set_margin(MARGIN_TOP, p->get_margin(MARGIN_TOP));
+ p_child->set_margin(MARGIN_BOTTOM, -p->get_margin(MARGIN_BOTTOM));
}
void PopupPanel::_notification(int p_what) {