From e5db39d07b6ff58d6f8f33c1c283e61f3084fd7a Mon Sep 17 00:00:00 2001 From: FireForge <67974470+fire-forge@users.noreply.github.com> Date: Wed, 25 May 2022 19:04:44 -0500 Subject: [PATCH] Remove extra space in property editors - NodePath, Resource, and multiline string --- editor/editor_properties.cpp | 2 ++ editor/editor_resource_picker.cpp | 2 ++ editor/editor_themes.cpp | 13 +++++-------- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp index 1253cdcafd0..be381ec62cf 100644 --- a/editor/editor_properties.cpp +++ b/editor/editor_properties.cpp @@ -156,6 +156,7 @@ void EditorPropertyMultilineText::_bind_methods() { EditorPropertyMultilineText::EditorPropertyMultilineText() { HBoxContainer *hb = memnew(HBoxContainer); + hb->add_constant_override("separation", 0); add_child(hb); set_bottom_editor(hb); text = memnew(TextEdit); @@ -2346,6 +2347,7 @@ void EditorPropertyNodePath::_bind_methods() { EditorPropertyNodePath::EditorPropertyNodePath() { HBoxContainer *hbc = memnew(HBoxContainer); + hbc->add_constant_override("separation", 0); add_child(hbc); assign = memnew(Button); assign->set_flat(true); diff --git a/editor/editor_resource_picker.cpp b/editor/editor_resource_picker.cpp index 5d4fb949cd9..74083ec41eb 100644 --- a/editor/editor_resource_picker.cpp +++ b/editor/editor_resource_picker.cpp @@ -864,6 +864,8 @@ EditorResourcePicker::EditorResourcePicker() { add_child(edit_menu); edit_menu->connect("id_pressed", this, "_edit_menu_cbk"); edit_menu->connect("popup_hide", edit_button, "set_pressed", varray(false)); + + add_constant_override("separation", 0); } void EditorScriptPicker::set_create_options(Object *p_menu_node) { diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp index 98fbaa15522..14f161c1e7c 100644 --- a/editor/editor_themes.cpp +++ b/editor/editor_themes.cpp @@ -744,14 +744,11 @@ Ref create_editor_theme(const Ref p_theme) { sub_inspector_bg = make_flat_stylebox(dark_color_1.linear_interpolate(si_base_color, 0.08), 2, 0, 2, 2); - sub_inspector_bg->set_border_width(MARGIN_LEFT, 2); - sub_inspector_bg->set_border_width(MARGIN_RIGHT, 2); - sub_inspector_bg->set_border_width(MARGIN_BOTTOM, 2); - sub_inspector_bg->set_border_width(MARGIN_TOP, 2); - sub_inspector_bg->set_default_margin(MARGIN_LEFT, 3); - sub_inspector_bg->set_default_margin(MARGIN_RIGHT, 3); - sub_inspector_bg->set_default_margin(MARGIN_BOTTOM, 10); - sub_inspector_bg->set_default_margin(MARGIN_TOP, 5); + sub_inspector_bg->set_border_width_all(2); + sub_inspector_bg->set_default_margin(MARGIN_LEFT, 4 * EDSCALE); + sub_inspector_bg->set_default_margin(MARGIN_RIGHT, 4 * EDSCALE); + sub_inspector_bg->set_default_margin(MARGIN_BOTTOM, 4 * EDSCALE); + sub_inspector_bg->set_default_margin(MARGIN_TOP, 4 * EDSCALE); sub_inspector_bg->set_border_color(si_base_color * Color(0.7, 0.7, 0.7, 0.8)); sub_inspector_bg->set_draw_center(true);