diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-06-11 18:55:01 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-11 18:55:01 +0200 |
commit | 1847094271bda14c947bf46cbc52a4ca1603fb69 (patch) | |
tree | c2da3885b23187e4489c2f1d855aa7a6ba147e4c /editor/editor_themes.cpp | |
parent | 126e4d0a5b182a2eea4e49e21344e376acdbba8c (diff) | |
parent | d605d1332414b7290e1d240cf55e63a28b6bbbec (diff) |
Merge pull request #59797 from fire-forge/array-margins
Diffstat (limited to 'editor/editor_themes.cpp')
-rw-r--r-- | editor/editor_themes.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp index 5ce6ca4823..7a80cf36a8 100644 --- a/editor/editor_themes.cpp +++ b/editor/editor_themes.cpp @@ -1283,6 +1283,13 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { theme->set_constant("h_separation", "VFlowContainer", default_margin_size * EDSCALE); theme->set_constant("v_separation", "VFlowContainer", default_margin_size * EDSCALE); + // Custom theme type for MarginContainer with 4px margins. + theme->set_type_variation("MarginContainer4px", "MarginContainer"); + theme->set_constant("margin_left", "MarginContainer4px", 4 * EDSCALE); + theme->set_constant("margin_top", "MarginContainer4px", 4 * EDSCALE); + theme->set_constant("margin_right", "MarginContainer4px", 4 * EDSCALE); + theme->set_constant("margin_bottom", "MarginContainer4px", 4 * EDSCALE); + // Window // Prevent corner artifacts between window title and body. @@ -1626,7 +1633,11 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { theme->set_stylebox("preview_picker_label", "ThemeEditor", theme_preview_picker_label_sb); // Dictionary editor add item. - theme->set_stylebox("DictionaryAddItem", "EditorStyles", make_flat_stylebox(prop_subsection_color, 4, 4, 4, 4, corner_radius)); + // Expand to the left and right by 4px to compensate for the dictionary editor margins. + Ref<StyleBoxFlat> style_dictionary_add_item = make_flat_stylebox(prop_subsection_color, 0, 4, 0, 4, corner_radius); + style_dictionary_add_item->set_expand_margin_size(SIDE_LEFT, 4 * EDSCALE); + style_dictionary_add_item->set_expand_margin_size(SIDE_RIGHT, 4 * EDSCALE); + theme->set_stylebox("DictionaryAddItem", "EditorStyles", style_dictionary_add_item); // adaptive script theme constants // for comments and elements with lower relevance |