summaryrefslogtreecommitdiffstats
path: root/scene/gui/subviewport_container.h
diff options
context:
space:
mode:
authorMarkus Sauermann <6299227+Sauermann@users.noreply.github.com>2024-11-15 09:28:57 +0100
committerMarkus Sauermann <6299227+Sauermann@users.noreply.github.com>2024-11-19 23:06:41 +0100
commit117158d2718d11c5026f4e2791c7784b4815d0aa (patch)
tree6dcd7b008e4359c29baad7e03ffef4a5b2935363 /scene/gui/subviewport_container.h
parent673f396677654220d7e1d5b6fb5ed3b50126b4e6 (diff)
downloadredot-engine-117158d2718d11c5026f4e2791c7784b4815d0aa.tar.gz
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.
Diffstat (limited to 'scene/gui/subviewport_container.h')
-rw-r--r--scene/gui/subviewport_container.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/scene/gui/subviewport_container.h b/scene/gui/subviewport_container.h
index 06420de730..7230615771 100644
--- a/scene/gui/subviewport_container.h
+++ b/scene/gui/subviewport_container.h
@@ -38,6 +38,8 @@ class SubViewportContainer : public Container {
bool stretch = false;
int shrink = 1;
+ bool consume_drag_and_drop = false;
+
void _notify_viewports(int p_notification);
bool _is_propagated_in_gui_input(const Ref<InputEvent> &p_event);
void _send_event_to_viewports(const Ref<InputEvent> &p_event);
@@ -63,6 +65,9 @@ public:
int get_stretch_shrink() const;
void recalc_force_viewport_sizes();
+ void set_consume_drag_and_drop(bool p_enable);
+ bool is_consume_drag_and_drop_enabled();
+
virtual Size2 get_minimum_size() const override;
virtual Vector<int> get_allowed_size_flags_horizontal() const override;