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>
This commit is contained in:
Yuri Sizov
2023-03-31 21:17:59 +02:00
parent 9fae65404a
commit 1522762dc9
28 changed files with 339 additions and 89 deletions

View File

@@ -183,7 +183,7 @@
<return type="int" />
<param index="0" name="column" type="int" />
<description>
Returns the column's icon's maximum width.
Returns the maximum allowed width of the icon in the given [param column].
</description>
</method>
<method name="get_icon_modulate" qualifiers="const">
@@ -545,7 +545,7 @@
<param index="0" name="column" type="int" />
<param index="1" name="width" type="int" />
<description>
Sets the given column's icon's maximum width.
Sets the maximum allowed width of the icon in the given [param column]. This limit is applied on top of the default size of the icon and on top of [theme_item Tree.icon_max_width]. The height is adjusted according to the icon's ratio.
</description>
</method>
<method name="set_icon_modulate">