diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-11-30 09:25:48 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-30 09:25:48 +0100 |
commit | 78d9aa99cabb47b2f285323e119bbef7972c1822 (patch) | |
tree | eb971259996025c62055de5ea5ba765c378abc9f | |
parent | 375cfa0d50d66c40ed96bb5094269bfa052ba31d (diff) | |
parent | 231231f9040f61ab49b840cd18d0bb9566e304c8 (diff) |
Merge pull request #43970 from EricEzaM/PR/popup-menu-margin-shrink
Reduced EditorTheme margin on PopupMenu
-rw-r--r-- | editor/editor_themes.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp index 88976ed332..c589a3c042 100644 --- a/editor/editor_themes.cpp +++ b/editor/editor_themes.cpp @@ -676,7 +676,14 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { theme->set_stylebox("panel", "PopupDialog", style_popup); // PopupMenu - theme->set_stylebox("panel", "PopupMenu", style_popup); + const int popup_menu_margin_size = default_margin_size * 1.5 * EDSCALE; + Ref<StyleBoxFlat> style_popup_menu = style_popup->duplicate(); + style_popup_menu->set_default_margin(MARGIN_LEFT, popup_menu_margin_size); + style_popup_menu->set_default_margin(MARGIN_TOP, popup_menu_margin_size); + style_popup_menu->set_default_margin(MARGIN_RIGHT, popup_menu_margin_size); + style_popup_menu->set_default_margin(MARGIN_BOTTOM, popup_menu_margin_size); + + theme->set_stylebox("panel", "PopupMenu", style_popup_menu); theme->set_stylebox("separator", "PopupMenu", style_popup_separator); theme->set_stylebox("labeled_separator_left", "PopupMenu", style_popup_labeled_separator_left); theme->set_stylebox("labeled_separator_right", "PopupMenu", style_popup_labeled_separator_right); |