From 2c0ca598357ac257bb2ea28be6ab713eba9e28f9 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 ef5413226..9fb615bac 100644 --- a/editor/editor_properties.cpp +++ b/editor/editor_properties.cpp @@ -212,6 +212,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); @@ -2654,6 +2655,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 901cc7ff6..0b5580367 100644 --- a/editor/editor_resource_picker.cpp +++ b/editor/editor_resource_picker.cpp @@ -896,6 +896,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 b16900580..acf82b290 100644 --- a/editor/editor_themes.cpp +++ b/editor/editor_themes.cpp @@ -765,14 +765,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);