Merge pull request #87417 from AThousandShips/tree_clear

Use callable for `TreeItem` custom draw
This commit is contained in:
Yuri Sizov 2024-01-24 14:08:36 +01:00
commit a32a2eaedc
4 changed files with 54 additions and 10 deletions

View file

@ -160,6 +160,13 @@
Returns the custom color of column [param column].
</description>
</method>
<method name="get_custom_draw_callback" qualifiers="const">
<return type="Callable" />
<param index="0" name="column" type="int" />
<description>
Returns the custom callback of column [param column].
</description>
</method>
<method name="get_custom_font" qualifiers="const">
<return type="Font" />
<param index="0" name="column" type="int" />
@ -553,7 +560,7 @@
Sets the given column's custom color.
</description>
</method>
<method name="set_custom_draw">
<method name="set_custom_draw" is_deprecated="true">
<return type="void" />
<param index="0" name="column" type="int" />
<param index="1" name="object" type="Object" />
@ -561,6 +568,16 @@
<description>
Sets the given column's custom draw callback to [param callback] method on [param object].
The [param callback] should accept two arguments: the [TreeItem] that is drawn and its position and size as a [Rect2].
[i]Deprecated.[/i] Use [method TreeItem.set_custom_draw_callback] instead.
</description>
</method>
<method name="set_custom_draw_callback">
<return type="void" />
<param index="0" name="column" type="int" />
<param index="1" name="callback" type="Callable" />
<description>
Sets the given column's custom draw callback. Use an empty [Callable] ([code skip-lint]Callable()[/code]) to clear the custom callback.
The [param callback] should accept two arguments: the [TreeItem] that is drawn and its position and size as a [Rect2].
</description>
</method>
<method name="set_custom_font">