diff options
author | Yuri Sizov <yuris@humnom.net> | 2023-03-31 21:17:59 +0200 |
---|---|---|
committer | Yuri Sizov <yuris@humnom.net> | 2023-03-31 21:39:02 +0200 |
commit | 1522762dc986c130ad63cbf854514d730788a4cf (patch) | |
tree | 81cbbbb7028bc95f828d78644b570e506736ece9 /scene/resources/default_theme | |
parent | 9fae65404a223a86816685b0b4036a57b8f976b7 (diff) | |
download | redot-engine-1522762dc986c130ad63cbf854514d730788a4cf.tar.gz |
Make icons of scripted and custom classes fit the editor UI
Also:
- Add an option to limit the icon size in PopupMenu.
This is similar to how this works in Tree and TreeItem.
- Add the same option to TabBar.
- Add a theme constant for Tree, PopupMenu, Button, and
TabBar to apply this limit on the control level.
Co-authored-by: Daylily-Zeleen <daylily-zeleen@foxmail.com>
Diffstat (limited to 'scene/resources/default_theme')
-rw-r--r-- | scene/resources/default_theme/default_theme.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/scene/resources/default_theme/default_theme.cpp b/scene/resources/default_theme/default_theme.cpp index 2e1ba96d11..4c7525c745 100644 --- a/scene/resources/default_theme/default_theme.cpp +++ b/scene/resources/default_theme/default_theme.cpp @@ -180,6 +180,7 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const theme->set_color("icon_disabled_color", "Button", Color(1, 1, 1, 0.4)); theme->set_constant("h_separation", "Button", 2 * scale); + theme->set_constant("icon_max_width", "Button", 0); // MenuBar theme->set_stylebox("normal", "MenuBar", button_normal); @@ -688,6 +689,7 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const theme->set_constant("separator_outline_size", "PopupMenu", 0); theme->set_constant("item_start_padding", "PopupMenu", 2 * scale); theme->set_constant("item_end_padding", "PopupMenu", 2 * scale); + theme->set_constant("icon_max_width", "PopupMenu", 0); // GraphNode Ref<StyleBoxFlat> graphnode_normal = make_flat_stylebox(style_normal_color, 18, 42, 18, 12); @@ -780,6 +782,7 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const theme->set_constant("scroll_border", "Tree", 4); theme->set_constant("scroll_speed", "Tree", 12); theme->set_constant("outline_size", "Tree", 0); + theme->set_constant("icon_max_width", "Tree", 0); // ItemList @@ -842,6 +845,7 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const theme->set_constant("side_margin", "TabContainer", 8 * scale); theme->set_constant("icon_separation", "TabContainer", 4 * scale); + theme->set_constant("icon_max_width", "TabContainer", 0); theme->set_constant("outline_size", "TabContainer", 0); // TabBar @@ -869,6 +873,7 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const theme->set_color("drop_mark_color", "TabBar", Color(1, 1, 1)); theme->set_constant("h_separation", "TabBar", 4 * scale); + theme->set_constant("icon_max_width", "TabBar", 0); theme->set_constant("outline_size", "TabBar", 0); // Separators |