1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Introduce a SubViewportContainer config for drag-and-drop targets

With the drag-and-drop rewrite, `SubViewportContainer` nodes were no
longer available as drop-locations.

This PR introduces a configuration option, that allows
`SubViewportContainer` to be considered as drop-location, but disables the
`Control` nodes inside its `SubViewport` children as drop-location.
This commit is contained in:
Markus Sauermann
2024-11-15 09:28:57 +01:00
parent 673f396677
commit 117158d271
4 changed files with 29 additions and 0 deletions

View File

@@ -20,6 +20,10 @@
</method>
</methods>
<members>
<member name="consume_drag_and_drop" type="bool" setter="set_consume_drag_and_drop" getter="is_consume_drag_and_drop_enabled" default="false">
If [code]false[/code], the [SubViewportContainer] is not available as a drop target in drag-and-drop operations, and instead the [Control] nodes inside its [Viewport] children are potential drop targets.
If [code]true[/code], the [SubViewportContainer] itself will be considered as a drop target in drag-and-drop operations, preventing the [Control] nodes inside its [Viewport] children from becoming drop targets.
</member>
<member name="focus_mode" type="int" setter="set_focus_mode" getter="get_focus_mode" overrides="Control" enum="Control.FocusMode" default="1" />
<member name="stretch" type="bool" setter="set_stretch" getter="is_stretch_enabled" default="false">
If [code]true[/code], the sub-viewport will be automatically resized to the control's size.