Merge pull request #110904 from YeldhamDev/tree_drag_unfolding

Unfold tree items on hover while drag-n-dropping
This commit is contained in:
Thaddeus Crews
2025-10-21 15:11:01 -05:00
11 changed files with 82 additions and 4 deletions

View File

@ -872,6 +872,9 @@
<member name="interface/editor/dock_tab_style" type="int" setter="" getter="">
Tab style of editor docks.
</member>
<member name="interface/editor/dragging_hover_wait_seconds" type="float" setter="" getter="">
During a drag-and-drop, this is how long to wait over a UI element before it triggers a reaction (e.g. a section unfolds to show nested items).
</member>
<member name="interface/editor/editor_language" type="String" setter="" getter="">
The language to use for the editor interface.
Translations are provided by the community. If you spot a mistake, [url=https://contributing.godotengine.org/en/latest/documentation/translation/index.html]contribute to editor translations on Weblate![/url]

View File

@ -370,6 +370,9 @@
The drop mode as an OR combination of flags. See [enum DropModeFlags] constants. Once dropping is done, reverts to [constant DROP_MODE_DISABLED]. Setting this during [method Control._can_drop_data] is recommended.
This controls the drop sections, i.e. the decision and drawing of possible drop locations based on the mouse position.
</member>
<member name="enable_drag_unfolding" type="bool" setter="set_enable_drag_unfolding" getter="is_drag_unfolding_enabled" default="true">
If [code]true[/code], tree items will unfold when hovered over during a drag-and-drop. The delay for when this happens is dictated by [theme_item dragging_unfold_wait_msec].
</member>
<member name="enable_recursive_folding" type="bool" setter="set_enable_recursive_folding" getter="is_recursive_folding_enabled" default="true">
If [code]true[/code], recursive folding is enabled for this [Tree]. Holding down [kbd]Shift[/kbd] while clicking the fold arrow or using [code]ui_right[/code]/[code]ui_left[/code] shortcuts collapses or uncollapses the [TreeItem] and all its descendants.
</member>
@ -561,6 +564,9 @@
<theme_item name="children_hl_line_width" data_type="constant" type="int" default="1">
The width of the relationship lines between the selected [TreeItem] and its children.
</theme_item>
<theme_item name="dragging_unfold_wait_msec" data_type="constant" type="int" default="500">
During a drag-and-drop, this is how many milliseconds to wait over a section before the section unfolds.
</theme_item>
<theme_item name="draw_guides" data_type="constant" type="int" default="1">
Draws the guidelines if not zero, this acts as a boolean. The guideline is a horizontal line drawn at the bottom of each item.
</theme_item>