summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric M <itsjusteza@gmail.com>2020-11-30 10:11:25 +1000
committerEric M <itsjusteza@gmail.com>2020-11-30 10:18:16 +1000
commit231231f9040f61ab49b840cd18d0bb9566e304c8 (patch)
tree6d374d2f9d3ddb31424483ccde2b2c89c779c4b9
parentd1943f6a77c9a1832795c6e095d61d8d5b63a371 (diff)
Reduced margin on PopupMenu
-rw-r--r--editor/editor_themes.cpp9
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);