summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorkobewi <kobewi4e@gmail.com>2022-12-16 15:14:50 +0100
committerkobewi <kobewi4e@gmail.com>2022-12-16 15:14:50 +0100
commitb28b7936dbedca44b2d9dde48450bdb453916ddd (patch)
treef4438dec2d3f8dc6fbc44590a565943714a57caf /editor
parent2e657e51f8818401f0a54a0df3d3e74446044b93 (diff)
Remove conditons for unfolding inspector sections
Diffstat (limited to 'editor')
-rw-r--r--editor/editor_inspector.cpp24
-rw-r--r--editor/editor_inspector.h1
2 files changed, 5 insertions, 20 deletions
diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp
index a5397a8e6a..3e655cdfe2 100644
--- a/editor/editor_inspector.cpp
+++ b/editor/editor_inspector.cpp
@@ -1374,38 +1374,22 @@ void EditorInspectorSection::_notification(int p_what) {
} break;
case NOTIFICATION_DRAG_BEGIN: {
- Dictionary dd = get_viewport()->gui_get_drag_data();
-
- // Only allow dropping if the section contains properties which can take the dragged data.
- bool children_can_drop = false;
- for (int child_idx = 0; child_idx < vbox->get_child_count(); child_idx++) {
- Control *editor_property = Object::cast_to<Control>(vbox->get_child(child_idx));
-
- // Test can_drop_data and can_drop_data_fw, since can_drop_data only works if set up with forwarding or if script attached.
- if (editor_property && (editor_property->can_drop_data(Point2(), dd) || editor_property->call("_can_drop_data_fw", Point2(), dd, this))) {
- children_can_drop = true;
- break;
- }
- }
-
- dropping = children_can_drop;
- queue_redraw();
+ dropping_for_unfold = true;
} break;
case NOTIFICATION_DRAG_END: {
- dropping = false;
- queue_redraw();
+ dropping_for_unfold = false;
} break;
case NOTIFICATION_MOUSE_ENTER: {
- if (dropping) {
+ if (dropping || dropping_for_unfold) {
dropping_unfold_timer->start();
}
queue_redraw();
} break;
case NOTIFICATION_MOUSE_EXIT: {
- if (dropping) {
+ if (dropping || dropping_for_unfold) {
dropping_unfold_timer->stop();
}
queue_redraw();
diff --git a/editor/editor_inspector.h b/editor/editor_inspector.h
index 41651494ce..23b1e9faf1 100644
--- a/editor/editor_inspector.h
+++ b/editor/editor_inspector.h
@@ -276,6 +276,7 @@ class EditorInspectorSection : public Container {
Timer *dropping_unfold_timer = nullptr;
bool dropping = false;
+ bool dropping_for_unfold = false;
HashSet<StringName> revertable_properties;